org.springframework.integration.aggregator
Class CorrelatingMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.aggregator.CorrelatingMessageHandler
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, Orderable, MessageHandler, MessageProducer, TrackableComponent
public class CorrelatingMessageHandler
- extends AbstractMessageHandler
- implements MessageProducer
Message handler that holds a buffer of correlated messages in a
MessageStore
. This class takes care of correlated groups of messages
that can be completed in batches. It is useful for aggregating, resequencing,
or custom implementations requiring correlation.
To customize this handler inject CorrelationStrategy
,
ReleaseStrategy
, and MessageGroupProcessor
implementations as
you require.
By default the CorrelationStrategy will be a
HeaderAttributeCorrelationStrategy and the ReleaseStrategy will be a
SequenceSizeReleaseStrategy.
- Since:
- 2.0
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DEFAULT_SEND_TIMEOUT
public static final long DEFAULT_SEND_TIMEOUT
- See Also:
- Constant Field Values
CorrelatingMessageHandler
public CorrelatingMessageHandler(MessageGroupProcessor processor,
MessageGroupStore store,
CorrelationStrategy correlationStrategy,
ReleaseStrategy releaseStrategy)
CorrelatingMessageHandler
public CorrelatingMessageHandler(MessageGroupProcessor processor,
MessageGroupStore store)
CorrelatingMessageHandler
public CorrelatingMessageHandler(MessageGroupProcessor processor)
setMessageStore
public void setMessageStore(MessageGroupStore store)
setCorrelationStrategy
public void setCorrelationStrategy(CorrelationStrategy correlationStrategy)
setReleaseStrategy
public void setReleaseStrategy(ReleaseStrategy releaseStrategy)
setOutputChannel
public void setOutputChannel(MessageChannel outputChannel)
- Description copied from interface:
MessageProducer
- Specify the MessageChannel to which produced Messages should be sent.
- Specified by:
setOutputChannel
in interface MessageProducer
onInit
protected void onInit()
throws java.lang.Exception
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this for initialization logic.
- Overrides:
onInit
in class IntegrationObjectSupport
- Throws:
java.lang.Exception
setDiscardChannel
public void setDiscardChannel(MessageChannel discardChannel)
setSendTimeout
public void setSendTimeout(long sendTimeout)
setSendPartialResultOnExpiry
public void setSendPartialResultOnExpiry(boolean sendPartialResultOnExpiry)
setReleasePartialSequences
public void setReleasePartialSequences(boolean releasePartialSequences)
getComponentType
public java.lang.String getComponentType()
- Description copied from class:
IntegrationObjectSupport
- Subclasses may implement this method to provide component type information.
- Specified by:
getComponentType
in interface NamedComponent
- Overrides:
getComponentType
in class AbstractMessageHandler
handleMessageInternal
protected void handleMessageInternal(Message<?> message)
throws java.lang.Exception
- Specified by:
handleMessageInternal
in class AbstractMessageHandler
- Throws:
java.lang.Exception