org.springframework.integration.router
Class RecipientListRouter
java.lang.Object
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.router.RecipientListRouter
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler
public class RecipientListRouter
- extends AbstractMessageHandler
- implements org.springframework.beans.factory.InitializingBean
A Message Router that sends Messages to a statically configured list of
recipients. The recipients are provided as a list of MessageChannel
instances. For dynamic recipient lists, consider instead using the @Router
annotation or extending AbstractChannelNameResolvingMessageRouter
.
- Author:
- Mark Fisher
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecipientListRouter
public RecipientListRouter()
setChannels
public void setChannels(java.util.List<MessageChannel> channels)
setTimeout
public void setTimeout(long timeout)
- Set the timeout for sending a message to the resolved channel. By
default, there is no timeout, meaning the send will block indefinitely.
setIgnoreSendFailures
public void setIgnoreSendFailures(boolean ignoreSendFailures)
- Specify whether send failures for one or more of the recipients
should be ignored. By default this is
false
meaning
that an Exception will be thrown whenever a send fails. To override
this and suppress Exceptions, set the value to true
.
setApplySequence
public void setApplySequence(boolean applySequence)
- Specify whether to apply the sequence number and size headers to the
messages prior to sending to the recipient channels. By default, this
value is
false
meaning that sequence headers will
not be applied. If planning to use an Aggregator downstream
with the default correlation and completion strategies, you should set
this flag to true
.
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
handleMessageInternal
protected void handleMessageInternal(Message<?> message)
throws java.lang.Exception
- Specified by:
handleMessageInternal
in class AbstractMessageHandler
- Throws:
java.lang.Exception