GH-3109 Add documentation to explain explicit binding naming convention

Resolves #3109
This commit is contained in:
Oleg Zhurakousky
2025-04-28 14:02:22 +02:00
parent 3c5113f3da
commit 165643cd6e
2 changed files with 11 additions and 0 deletions

View File

@@ -34,3 +34,12 @@ 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.
IMPORTANT: Unlike with xref:spring-cloud-stream/functional-binding-names.adoc[Functional Binding Names], explicitly created bindings
do not require additional suffix such as `in-0/out-0` given that:
- the binding name is not backed by a function
- it already represents _input_ or _output_ binding by definition
- it can not have more then one input or output.
So `spring.cloud.stream.output-bindings=hello` will result in the binding named `hello` (not `hello-out-0`) and you can further refer to it as `spring.cloud.stream.bindings.hello.destination=foobar`

View File

@@ -28,6 +28,8 @@ The `in` and `out` corresponds to the type of binding (such as _input_ or _outpu
The `index` is the index of the input or output binding. It is always 0 for typical single input/output function,
so it's only relevant for xref:spring-cloud-stream/producing-and-consuming-messages.adoc#functions_with_multiple_input_and_output_arguments[Functions with multiple input and output arguments].
IMPORTANT: For xref:spring-cloud-stream/explicit-binding-creation.adoc[Explicit Binding Names], the above naming convention is not necessary (see xref:spring-cloud-stream/explicit-binding-creation.adoc[Explicit Binding Creation])
So if for example you would want to map the input of this function to a remote
destination (e.g., topic, queue etc) called "my-topic" you would do so with the following property:
----