public class CorrelatingMessageBarrier extends AbstractMessageHandler implements MessageSource<java.lang.Object>
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 AbstractCorrelatingMessageHandler 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.
AbstractCorrelatingMessageHandler
logger
Constructor and Description |
---|
CorrelatingMessageBarrier() |
CorrelatingMessageBarrier(MessageGroupStore store) |
Modifier and Type | Method and Description |
---|---|
protected void |
handleMessageInternal(Message<?> message) |
Message<java.lang.Object> |
receive()
Retrieve the next available message from this source.
|
void |
setCorrelationStrategy(CorrelationStrategy correlationStrategy)
Set the CorrelationStrategy to be used to determine the correlation key for incoming messages
|
void |
setReleaseStrategy(ReleaseStrategy releaseStrategy)
Set the ReleaseStrategy that should be used when deciding if a group in this barrier may be released.
|
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public CorrelatingMessageBarrier(MessageGroupStore store)
public CorrelatingMessageBarrier()
public void setCorrelationStrategy(CorrelationStrategy correlationStrategy)
public void setReleaseStrategy(ReleaseStrategy releaseStrategy)
protected void handleMessageInternal(Message<?> message) throws java.lang.Exception
handleMessageInternal
in class AbstractMessageHandler
java.lang.Exception
public Message<java.lang.Object> receive()
MessageSource
null
if no message is available.receive
in interface MessageSource<java.lang.Object>