Class RecipientListRouter

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, IntegrationPattern, MessageRouter, RecipientListRouterManagement, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class RecipientListRouter extends AbstractMessageRouter implements RecipientListRouterManagement
 <recipient-list-router id="simpleRouter" input-channel="routingChannelA">
     <recipient channel="channel1"/>
     <recipient channel="channel2"/>

A Message Router that sends Messages to a list of recipient channels. The recipients can be provided as a static list of MessageChannel instances via the setChannels(List) method, or for dynamic behavior, the values can be provided via the setRecipients(List) method.

For more advanced, programmatic control of dynamic recipient lists, consider using the @Router annotation or extending AbstractMappingMessageRouter instead.

Contrary to a standard <router .../> this handler will try to send to all channels that are configured as recipients. It is to channels what a publish subscribe channel is to endpoints.

Using this class only makes sense if it is essential to send messages on multiple channels instead of sending them to multiple handlers. If the latter is an option using a publish subscribe channel is the more flexible solution.

Mark Fisher, Oleg Zhurakousky, Artem Bilan, Liujiong, Gary Russell