Skip to content

GH-2890: Document a bridge for subflow starts #3040

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.3.40'
ext.kotlinVersion = '1.3.50'
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
}
Expand Down
18 changes: 18 additions & 0 deletions src/reference/asciidoc/dsl.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,24 @@ When you configure a sub-flow as a lambda, the framework handles the request-rep
Sub-flows can be nested to any depth, but we do not recommend doing so.
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.

[NOTE]
====
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 flow's input channel and that channel.
For example, in this `filter` definition:

[source,java]
----
.filter(p -> p instanceof String, e -> e
.discardFlow(df -> df
.channel(MessageChannels.queue())
...)
----
the Framework creates internally a `DirectChannel` bean for injecting into the `MessageFilter.discardChannel`.
Then it wraps the subflow into an `IntegrationFlow` starting with this implicit channel for subscription and places a `bridge` before the mentioned `channel()` in the flow.
When an existing `IntegrationFlow` bean is used as a subflow reference, there is no such bridge in between since the framework can resolve the first channel from the flow bean.
This information is not available yet from inline subflows.
====

[[java-dsl-protocol-adapters]]
=== Using Protocol Adapters

Expand Down