Broadcast
Experimental
@Broadcast
is an experimental feature.
By default, messages transiting in a channel are only dispatched to a single consumer. Having multiple consumers is considered as an error, and is reported at deployment time.
The Broadcast
annotation changes this behavior and indicates that messages transiting
in the channel are dispatched to all the consumers. @Broadcast
must be
used with the @Outgoing
annotation:
In the previous example, both consumers get the messages.
You can also control the number of consumers to wait before starting to dispatch the messages. This allows waiting for the complete graph to be woven:
Note
Inbound connectors also support a broadcast
attribute that allows
broadcasting the messages to multiple downstream subscribers.
Use with Emitter
For details on how to use @Broadcast
with Emitter
see the
documentation.