Class BroadcastingDispatcher
- All Implemented Interfaces:
- Aware,- BeanFactoryAware,- MessageDispatcher
If the 'ignoreFailures' flag is set to true on the other hand, it will make a best effort to send the message to each of its handlers. In other words, when 'ignoreFailures' is true, if it fails to send to any one handler, it will simply log a warn-level message but continue to send the Message to any other handlers.
 If the 'requireSubscribers' flag is set to true, the sent message is considered as non-dispatched
 and rejected to the caller with the "Dispatcher has no subscribers" MessageDispatchingException.
- Author:
- Mark Fisher, Iwein Fuld, Gary Russell, Oleg Zhurakousky, Artem Bilan
- 
Field SummaryFields inherited from class org.springframework.integration.dispatcher.AbstractDispatcherlogger
- 
Constructor SummaryConstructorsConstructorDescriptionBroadcastingDispatcher(boolean requireSubscribers) BroadcastingDispatcher(Executor executor) BroadcastingDispatcher(Executor executor, boolean requireSubscribers) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanDispatch the message.protected MessageBuilderFactoryvoidsetApplySequence(boolean applySequence) Specify whether to apply sequence numbers to the messages prior to sending to the handlers.voidsetBeanFactory(BeanFactory beanFactory) voidsetIgnoreFailures(boolean ignoreFailures) Specify whether failures for one or more of the handlers should be ignored.voidsetMessageHandlingTaskDecorator(MessageHandlingTaskDecorator messageHandlingTaskDecorator) voidsetMinSubscribers(int minSubscribers) If at least this number of subscribers receive the message,dispatch(Message)will return true.Methods inherited from class org.springframework.integration.dispatcher.AbstractDispatcheraddHandler, getHandlerCount, getHandlers, removeHandler, setMaxSubscribers, toString, tryOptimizedDispatch
- 
Constructor Details- 
BroadcastingDispatcherpublic BroadcastingDispatcher()
- 
BroadcastingDispatcher
- 
BroadcastingDispatcherpublic BroadcastingDispatcher(boolean requireSubscribers) 
- 
BroadcastingDispatcher
 
- 
- 
Method Details- 
setIgnoreFailurespublic void setIgnoreFailures(boolean ignoreFailures) Specify whether failures for one or more of the handlers should be ignored. By default this is false meaning that an Exception will be thrown when a handler fails. To override this and suppress Exceptions, set the value to true.Keep in mind that when using an Executor, even without ignoring the failures, other handlers may be invoked after one throws an Exception. Since the Executor is most likely using a different thread, this flag would only affect whether an error Message is sent to the error channel or not in the case that such an Executor has been configured. - Parameters:
- ignoreFailures- true when failures are to be ignored.
 
- 
setApplySequencepublic void setApplySequence(boolean applySequence) Specify whether to apply sequence numbers to the messages prior to sending to the handlers. By default, sequence numbers will not be applied.- Parameters:
- applySequence- true when sequence information should be applied.
 
- 
setMinSubscriberspublic void setMinSubscribers(int minSubscribers) If at least this number of subscribers receive the message,dispatch(Message)will return true. Default: 0.- Parameters:
- minSubscribers- The minimum number of subscribers.
 
- 
setMessageHandlingTaskDecoratorpublic void setMessageHandlingTaskDecorator(MessageHandlingTaskDecorator messageHandlingTaskDecorator) 
- 
setBeanFactory- Specified by:
- setBeanFactoryin interface- BeanFactoryAware
- Throws:
- BeansException
 
- 
getMessageBuilderFactory
- 
dispatchDescription copied from interface:MessageDispatcherDispatch the message.- Specified by:
- dispatchin interface- MessageDispatcher
- Parameters:
- message- the message.
- Returns:
- true if dispatched.
 
 
-