org.springframework.integration.dispatcher
Class BroadcastingDispatcher
java.lang.Object
org.springframework.integration.dispatcher.AbstractDispatcher
org.springframework.integration.dispatcher.BroadcastingDispatcher
- All Implemented Interfaces:
- MessageDispatcher, MessageSource, MessageTarget, SubscribableSource
public class BroadcastingDispatcher
- extends AbstractDispatcher
A broadcasting dispatcher implementation. It makes a best effort to
send the message to each of its targets. If it fails to send to any
one target, it will log a warn-level message but continue to send
to the other targets.
- Author:
- Mark Fisher
Method Summary |
boolean |
send(Message<?> message)
Send a Message to this target. |
void |
setApplySequence(boolean applySequence)
Specify whether to apply sequence numbers to the messages
prior to sending to the targets. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
applySequence
private volatile boolean applySequence
BroadcastingDispatcher
public BroadcastingDispatcher()
setApplySequence
public void setApplySequence(boolean applySequence)
- Specify whether to apply sequence numbers to the messages
prior to sending to the targets. By default, sequence
numbers will not be applied
send
public boolean send(Message<?> message)
- Description copied from interface:
MessageTarget
- Send a
Message
to this target. May throw a RuntimeException for non-recoverable
errors. Otherwise, if the Message cannot be sent for a non-fatal reason such as timeout,
then this method will return 'false', and if the Message is sent successfully, it will
return 'true'.
- Parameters:
message
- the Message to send
- Returns:
- whether the Message has been sent successfully