You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/reference/asciidoc/dsl.adoc
+36-4Lines changed: 36 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
[[java-dsl]]
2
2
== Java DSL
3
3
4
-
The Spring Integration JavaConfig and DSL extension provides a set of convenient Builders and a fluent API to configure Spring Integration message flows from Spring `@Configuration` classes.
4
+
The Spring Integration JavaConfig and DSL provides a set of convenient Builders and a fluent API to configure Spring Integration message flows from Spring `@Configuration` classes.
5
5
6
6
[[java-dsl-example]]
7
7
=== Example Configurations
@@ -492,9 +492,42 @@ public IntegrationFlow loggingFlow() {
492
492
----
493
493
494
494
[IMPORTANT]
495
+
====
496
+
The `log()` or `wireTap()` opearators are applied to the current `MessageChannel` (if it is an instance of `ChannelInterceptorAware`) or an intermediate `DirectChannel` is injected into the flow for the currently configured endpoint.
497
+
In the example above the `WireTap` interceptor is added to the `myChannel` directly, because `QueueChannel` implements `ChannelInterceptorAware`:
498
+
====
499
+
500
+
[source,java]
501
+
----
502
+
@Bean
503
+
MessageChannel myChannel() {
504
+
return new DirectChannel();
505
+
}
506
+
507
+
...
508
+
.channel(myChannel())
509
+
.log()
510
+
}
511
+
----
512
+
513
+
When current `MessageChannel` doesn't implement `ChannelInterceptorAware`, an implicit `DirectChannel` and `BridgeHandler` are injected into the `IntegrationFlow` and the `WireTap` is added to this new `DirectChannel`.
514
+
And when there is not any channel declaration like in this sample:
515
+
516
+
[source,java]
517
+
----
518
+
.handle(...)
519
+
.log()
520
+
}
521
+
----
522
+
523
+
an implicit `DirectChannel` is injected in the current position of the `IntegrationFlow` and it is used as an output channel for the currently configured `ServiceActivatingHandler` (the `.handle()` above).
524
+
525
+
[IMPORTANT]
526
+
=====
527
+
If `log()` or `wireTap()` are used in the end of flow they are considered one-way `MessageHandler` s.
528
+
If the integration flow is expected to return a reply, a `bridge()` should be added to the end, after `log()` or `wireTap()`:
495
529
=====
496
-
If `log()` or `wireTap()` are used in the end of flow they are considered as one-way `MessageHandler` s.
497
-
If the integration flow is expected to return reply, the `bridge()` should be used in the end, after `log()` or `wireTap()`:
530
+
498
531
[source,java]
499
532
----
500
533
@Bean
@@ -509,7 +542,6 @@ public IntegrationFlow sseFlow() {
0 commit comments