Class ResequencingMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler
org.springframework.integration.aggregator.ResequencingMessageHandler
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- ApplicationEventPublisherAware,- Lifecycle,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- MessageProducer,- DiscardingMessageHandler,- HeaderPropagationAware,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- ManageableLifecycle,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
Resequencer specific implementation of 
AbstractCorrelatingMessageHandler.
 Will remove MessageGroups only if 'sequenceSize' is provided and reached.- Since:
- 2.1
- Author:
- Oleg Zhurakousky, Gary Russell, Artem Bilan
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.aggregator.AbstractCorrelatingMessageHandlerAbstractCorrelatingMessageHandler.SequenceAwareMessageGroupNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandlermessagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionResequencingMessageHandler(MessageGroupProcessor processor) ResequencingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store) ResequencingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidafterRelease(MessageGroup messageGroup, Collection<Message<?>> completedMessages) Allows you to provide additional logic that needs to be performed after the MessageGroup was released.protected voidafterRelease(MessageGroup messageGroup, Collection<Message<?>> completedMessages, boolean timeout) Perform group removal if itssizeis equal to thesequenceSize.Subclasses may implement this method to provide component type information.Return a pattern type this component implements.final voidsetExpireGroupsUponTimeout(boolean expireGroupsUponTimeout) Overridden to false for a resequencer so late messages are immediately discarded rather than waiting for the next timeout.protected booleanSubclasses may override this.Methods inherited from class org.springframework.integration.aggregator.AbstractCorrelatingMessageHandlercompleteGroup, completeGroup, destroy, expireGroup, findLastReleasedSequenceNumber, forceComplete, getCorrelationStrategy, getDiscardChannel, getDiscardChannelName, getEvaluationContext, getExpireGroupScheduledFutures, getGroupConditionSupplier, getGroupTimeoutExpression, getLockRegistry, getMessageStore, getMinimumTimeoutForEmptyGroups, getOutputProcessor, getReleaseStrategy, handleMessageInternal, isExpireGroupsUponCompletion, isLockRegistrySet, isReleaseLockBeforeSend, isReleasePartialSequences, isRunning, isSendPartialResultOnExpiry, isSequenceAware, obtainGroupTimeout, onInit, purgeOrphanedGroups, remove, setApplicationEventPublisher, setCorrelationStrategy, setDiscardChannel, setDiscardChannelName, setDiscardIndividuallyOnExpiry, setExpireDuration, setExpireDurationMillis, setExpireTimeout, setForceReleaseAdviceChain, setGroupConditionSupplier, setGroupTimeoutExpression, setLockRegistry, setMessageStore, setMinimumTimeoutForEmptyGroups, setOutputProcessor, setPopSequence, setReleaseLockBeforeSend, setReleasePartialSequences, setReleaseStrategy, setSendPartialResultOnExpiry, start, stop, store, verifyResultCollectionConsistsOfMessagesMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandleraddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.messaging.MessageHandlerhandleMessageMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
ResequencingMessageHandlerpublic ResequencingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy) 
- 
ResequencingMessageHandler
- 
ResequencingMessageHandler
 
- 
- 
Method Details- 
setExpireGroupsUponTimeoutpublic final void setExpireGroupsUponTimeout(boolean expireGroupsUponTimeout) Overridden to false for a resequencer so late messages are immediately discarded rather than waiting for the next timeout.- Overrides:
- setExpireGroupsUponTimeoutin class- AbstractCorrelatingMessageHandler
- Parameters:
- expireGroupsUponTimeout- the expireGroupsUponTimeout to set
 
- 
getComponentTypeDescription copied from class:IntegrationObjectSupportSubclasses may implement this method to provide component type information.- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- AbstractCorrelatingMessageHandler
 
- 
getIntegrationPatternTypeDescription copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
- getIntegrationPatternTypein interface- IntegrationPattern
- Overrides:
- getIntegrationPatternTypein class- MessageHandlerSupport
- Returns:
- the IntegrationPatternTypethis component implements.
 
- 
shouldCopyRequestHeadersprotected boolean shouldCopyRequestHeaders()Description copied from class:AbstractMessageProducingHandlerSubclasses may override this. True by default.- Overrides:
- shouldCopyRequestHeadersin class- AbstractMessageProducingHandler
- Returns:
- true if the request headers should be copied.
 
- 
afterReleaseDescription copied from class:AbstractCorrelatingMessageHandlerAllows you to provide additional logic that needs to be performed after the MessageGroup was released.- Specified by:
- afterReleasein class- AbstractCorrelatingMessageHandler
- Parameters:
- messageGroup- The group.
- completedMessages- The completed messages.
 
- 
afterReleaseprotected void afterRelease(MessageGroup messageGroup, Collection<Message<?>> completedMessages, boolean timeout) Perform group removal if itssizeis equal to thesequenceSize. RemovecompletedMessagesfrom the group if it isn't null.- Overrides:
- afterReleasein class- AbstractCorrelatingMessageHandler
- Parameters:
- messageGroup- the group to clean up.
- completedMessages- The completed messages.
- timeout- True if the release/discard was due to a timeout.
 
 
-