GH-2626 Fix documentation related to explicit binding name change

This commit is contained in:
Oleg Zhurakousky
2023-01-19 15:44:15 +01:00
parent 6f86e28b48
commit 446d066c1d

View File

@@ -339,9 +339,9 @@ For more on properties and other configuration options please see <<Configuratio
===== Explicit binding creation
In the previous section we explained how bindings are created implicitly driven by Function, Supplier or Consumer provided by your application.
In the previous section we explained how bindings are created implicitly driven by the names of `Function`, `Supplier` or `Consumer` beans provided by your application.
However, there are times when you may need to create binding explicitly where bindings are not tied to any function. This is typically done to
support integrations with other frameworks (e.g., Spring Integration framework) where you may need direct access to the underlying `MessageChannel`.
support integrations with other frameworks via `StreamBridge`.
Spring Cloud Stream allows you to define input and output bindings explicitly via `spring.cloud.stream.input-bindings` and `spring.cloud.stream.output-bindings`
properties. Noticed the plural in the property names allowing you to define multiple bindings by simply using `;` as a delimiter.
@@ -357,10 +357,8 @@ public void testExplicitBindings() {
"--spring.cloud.stream.input-bindings=fooin;barin",
"--spring.cloud.stream.output-bindings=fooout;barout")) {
assertThat(context.getBean("fooin-in-0", MessageChannel.class)).isNotNull();
assertThat(context.getBean("barin-in-0", MessageChannel.class)).isNotNull();
assertThat(context.getBean("fooout-out-0", MessageChannel.class)).isNotNull();
assertThat(context.getBean("barout-out-0", MessageChannel.class)).isNotNull();
. . .
}
}
@@ -372,8 +370,6 @@ public static class EmptyConfiguration {
As you can see we have declared two input bindings and two output bindings while our configuration had no functions defined, yet we were able to successfully create these bindings and access their corresponding channels.
The rest of the binding rules that apply to implicit bindings apply here as well (for example, you can see that `fooin` turned into `fooin-in-0` binding/channel etc).
=== Producing and Consuming Messages