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, MessageHandler, MessageProducer, NamedComponent
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
- Author:
- Iwein Fuld, Dave Syer
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString, writeMessageHistory |
DEFAULT_SEND_TIMEOUT
public static final long DEFAULT_SEND_TIMEOUT
- See Also:
- Constant Field Values
DEFAULT_REAPER_INTERVAL
public static final long DEFAULT_REAPER_INTERVAL
- See Also:
- Constant Field Values
DEFAULT_TIMEOUT
public static final long DEFAULT_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
setChannelResolver
public void setChannelResolver(ChannelResolver channelResolver)
- Overrides:
setChannelResolver
in class IntegrationObjectSupport
setDiscardChannel
public void setDiscardChannel(MessageChannel discardChannel)
setSendTimeout
public void setSendTimeout(long sendTimeout)
setSendPartialResultOnExpiry
public void setSendPartialResultOnExpiry(boolean sendPartialResultOnExpiry)
getComponentType
public 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 Exception
- Specified by:
handleMessageInternal
in class AbstractMessageHandler
- Throws:
Exception
Copyright © 2010. All Rights Reserved.