Skip to content

Commit 5b43b6c

Browse files
artembilangaryrussell
authored andcommitted
GH-2890: Document a bridge for subflow starts
Fixes #2890 Explain in a docs why and how a `bridge` appears in the flow when we declare a subflow for mapping * Upgrade to Kotlin `1.3.50` * Upgrade to Kotlin `1.3.50` * Polishing Doc according PR comments Doc polishing
1 parent 0750867 commit 5b43b6c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
buildscript {
2-
ext.kotlinVersion = '1.3.40'
2+
ext.kotlinVersion = '1.3.50'
33
repositories {
44
maven { url 'https://repo.spring.io/plugins-release' }
55
}

src/reference/asciidoc/dsl.adoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,24 @@ When you configure a sub-flow as a lambda, the framework handles the request-rep
816816
Sub-flows can be nested to any depth, but we do not recommend doing so.
817817
In fact, even in the router case, adding complex sub-flows within a flow would quickly begin to look like a plate of spaghetti and be difficult for a human to parse.
818818

819+
[NOTE]
820+
====
821+
In cases where the DSL supports a subflow configuration, when a channel is normally needed for the component being configured, and that subflow starts with a `channel()` element, the framework implicitly places a `bridge()` between the component output channel and the flow's input channel.
822+
For example, in this `filter` definition:
823+
824+
[source,java]
825+
----
826+
.filter(p -> p instanceof String, e -> e
827+
.discardFlow(df -> df
828+
.channel(MessageChannels.queue())
829+
...)
830+
----
831+
the Framework internally creates a `DirectChannel` bean for injecting into the `MessageFilter.discardChannel`.
832+
Then it wraps the subflow into an `IntegrationFlow` starting with this implicit channel for the subscription and places a `bridge` before the `channel()` specified in the flow.
833+
When an existing `IntegrationFlow` bean is used as a subflow reference (instead of an inline subflow, e.g. a lambda), there is no such bridge required because the framework can resolve the first channel from the flow bean.
834+
With an inline subflow, the input channel is not yet available.
835+
====
836+
819837
[[java-dsl-protocol-adapters]]
820838
=== Using Protocol Adapters
821839

0 commit comments

Comments
 (0)