org.springframework.integration.aggregator
Class CorrelatingMessageBarrier
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.aggregator.CorrelatingMessageBarrier
- All Implemented Interfaces:
- BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, Orderable, MessageHandler, MessageSource<java.lang.Object>, TrackableComponent
public class CorrelatingMessageBarrier
- extends AbstractMessageHandler
- implements MessageSource<java.lang.Object>
This Endpoint serves as a barrier for messages that should not be processed yet. The decision when a message can be
processed is delegated to a ReleaseStrategy
.
When a message can be processed it is up to the client to take care of the locking (potentially from the ReleaseStrategy's
canRelease(..)
method).
This class differs from CorrelatingMessageHandler in that it completely decouples the receiver and the sender. It can
be applied in scenarios where completion of a message group is not well defined but only a certain amount of messages
for any given correlation key may be processed at a time.
The messages will be stored in a MessageStore
for each correlation key.
- See Also:
CorrelatingMessageHandler
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CorrelatingMessageBarrier
public CorrelatingMessageBarrier(MessageGroupStore store)
CorrelatingMessageBarrier
public CorrelatingMessageBarrier()
setCorrelationStrategy
public void setCorrelationStrategy(CorrelationStrategy correlationStrategy)
- Set the CorrelationStrategy to be used to determine the correlation key for incoming messages
setReleaseStrategy
public void setReleaseStrategy(ReleaseStrategy releaseStrategy)
- Set the ReleaseStrategy that should be used when deciding if a group in this barrier may be released.
handleMessageInternal
protected void handleMessageInternal(Message<?> message)
throws java.lang.Exception
- Specified by:
handleMessageInternal
in class AbstractMessageHandler
- Throws:
java.lang.Exception
receive
public Message<java.lang.Object> receive()
- Description copied from interface:
MessageSource
- Retrieve the next available message from this source.
Returns
null
if no message is available.
- Specified by:
receive
in interface MessageSource<java.lang.Object>