The log() in the end IMPORTANT note in dsl.adoc

This commit is contained in:
Artem Bilan
2017-11-15 15:21:14 -05:00
parent 89614f7ff6
commit 1244c6c22a
2 changed files with 21 additions and 4 deletions

View File

@@ -2742,9 +2742,6 @@ public abstract class IntegrationFlowDefinition<B extends IntegrationFlowDefinit
return target;
}
Advised advised = (Advised) target;
if (advised.getTargetSource() == null) {
return null;
}
try {
return extractProxyTarget(advised.getTargetSource().getTarget());
}

View File

@@ -460,7 +460,7 @@ Of course we register some custom `BytesToIntegerConverter` within `ConversionSe
For convenience to log the message journey throw the Spring Integration flow (`<logging-channel-adapter>`), a `log()` operator is presented.
Underneath it is represented by the `WireTap` `ChannelInterceptor` and `LoggingHandler` as subscriber.
It is responsible to log message incoming into the next endpoint:
It is responsible to log message incoming into the next endpoint or for the current channel:
[source,java]
----
@@ -491,6 +491,26 @@ public IntegrationFlow loggingFlow() {
}
----
[IMPORTANT]
=====
If `log()` or `wireTap()` are used in the end of flow they are considered as one-way `MessageHandler` s.
If the integration flow is expected to return reply, the `bridge()` should be used in the end, after `log()` or `wireTap()`:
[source,java]
----
@Bean
public IntegrationFlow sseFlow() {
return IntegrationFlows
.from(WebFlux.inboundGateway("/sse")
.requestMapping(m ->
m.produces(MediaType.TEXT_EVENT_STREAM_VALUE)))
.handle((p, h) -> Flux.just("foo", "bar", "baz"))
.log(LoggingHandler.Level.WARN)
.bridge()
.get();
}
----
=====
[[java-dsl-flows]]
=== Working With Message Flows