Class CorrelatingMessageBarrier
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.aggregator.CorrelatingMessageBarrier
- All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>,Aware,BeanFactoryAware,BeanNameAware,DisposableBean,InitializingBean,ApplicationContextAware,Ordered,ExpressionCapable,Orderable,MessageSource<Object>,IntegrationPattern,NamedComponent,IntegrationManagement,TrackableComponent,MessageHandler,reactor.core.CoreSubscriber<Message<?>>
public class CorrelatingMessageBarrier
extends AbstractMessageHandler
implements MessageSource<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 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.
- Author:
- Iwein Fuld, Oleg Zhurakousky, Gary Russell, Artem Bilan, Trung Pham
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides -
Field Summary
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprotected voidhandleMessageInternal(Message<?> message) receive()Retrieve the next available message from this source.voidsetCorrelationStrategy(CorrelationStrategy correlationStrategy) Set the CorrelationStrategy to be used to determine the correlation key for incoming messages.voidsetReleaseStrategy(ReleaseStrategy releaseStrategy) Set the ReleaseStrategy that should be used when deciding if a group in this barrier may be released.Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, destroy, getComponentType, getIntegrationPatternType, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscriber
currentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAsMethods inherited from interface org.springframework.integration.core.MessageSource
getIntegrationPatternTypeMethods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
CorrelatingMessageBarrier
public CorrelatingMessageBarrier() -
CorrelatingMessageBarrier
-
-
Method Details
-
setCorrelationStrategy
Set the CorrelationStrategy to be used to determine the correlation key for incoming messages.- Parameters:
correlationStrategy- The correlation strategy.
-
setReleaseStrategy
Set the ReleaseStrategy that should be used when deciding if a group in this barrier may be released.- Parameters:
releaseStrategy- The release strategy.
-
handleMessageInternal
- Specified by:
handleMessageInternalin classAbstractMessageHandler
-
receive
Description copied from interface:MessageSourceRetrieve the next available message from this source. Returnsnullif no message is available.- Specified by:
receivein interfaceMessageSource<Object>- Returns:
- The message or null.
-