Class AggregatingMessageHandler
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.AggregatingMessageHandler
- All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>
,Aware
,BeanFactoryAware
,BeanNameAware
,DisposableBean
,InitializingBean
,ApplicationContextAware
,ApplicationEventPublisherAware
,Lifecycle
,Ordered
,ExpressionCapable
,Orderable
,MessageProducer
,DiscardingMessageHandler
,HeaderPropagationAware
,IntegrationPattern
,NamedComponent
,IntegrationManagement
,ManageableLifecycle
,TrackableComponent
,MessageHandler
,reactor.core.CoreSubscriber<Message<?>>
public class AggregatingMessageHandler extends AbstractCorrelatingMessageHandler
Aggregator specific implementation of
AbstractCorrelatingMessageHandler
.
Will remove MessageGroup
s in the afterRelease(org.springframework.integration.store.MessageGroup, java.util.Collection<org.springframework.messaging.Message<?>>)
only if 'expireGroupsUponCompletion' flag is set to 'true'.- Since:
- 2.1
- Author:
- Oleg Zhurakousky, Artem Bilan, Gary Russell
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler
AbstractCorrelatingMessageHandler.SequenceAwareMessageGroup
Nested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagement
IntegrationManagement.ManagementOverrides
-
Field Summary
Fields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
messagingTemplate
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
EXPRESSION_PARSER, logger
Fields inherited from interface org.springframework.integration.support.management.IntegrationManagement
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
Constructors Constructor Description AggregatingMessageHandler(MessageGroupProcessor processor)
AggregatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store)
AggregatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy)
-
Method Summary
Modifier and Type Method Description protected void
afterRelease(MessageGroup messageGroup, Collection<Message<?>> completedMessages)
Complete the group and remove all its messages.IntegrationPatternType
getIntegrationPatternType()
Return a pattern type this component implements.protected boolean
isExpireGroupsUponCompletion()
void
setExpireGroupsUponCompletion(boolean expireGroupsUponCompletion)
Will set the 'expireGroupsUponCompletion' flag.Methods inherited from class org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler
afterRelease, completeGroup, completeGroup, destroy, expireGroup, findLastReleasedSequenceNumber, forceComplete, getComponentType, getCorrelationStrategy, getDiscardChannel, getDiscardChannelName, getEvaluationContext, getExpireGroupScheduledFutures, getGroupConditionSupplier, getGroupTimeoutExpression, getLockRegistry, getMessageStore, getMinimumTimeoutForEmptyGroups, getOutputProcessor, getReleaseStrategy, handleMessageInternal, isLockRegistrySet, isReleaseLockBeforeSend, isReleasePartialSequences, isRunning, isSendPartialResultOnExpiry, isSequenceAware, obtainGroupTimeout, onInit, purgeOrphanedGroups, remove, setApplicationEventPublisher, setCorrelationStrategy, setDiscardChannel, setDiscardChannelName, setExpireDuration, setExpireDurationMillis, setExpireGroupsUponTimeout, setExpireTimeout, setForceReleaseAdviceChain, setGroupConditionSupplier, setGroupTimeoutExpression, setLockRegistry, setMessageStore, setMinimumTimeoutForEmptyGroups, setOutputProcessor, setPopSequence, setReleaseLockBeforeSend, setReleasePartialSequences, setReleaseStrategy, setSendPartialResultOnExpiry, start, stop, store, verifyResultCollectionConsistsOfMessages
Methods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandler
addNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeaders
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
handleMessage, onComplete, onError, onNext, onSubscribe
Methods inherited from class org.springframework.integration.handler.MessageHandlerSupport
buildSendTimer, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
Methods 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, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.management.IntegrationManagement
getThisAs
Methods inherited from interface org.springframework.integration.support.context.NamedComponent
getBeanName, getComponentName
-
Constructor Details
-
AggregatingMessageHandler
public AggregatingMessageHandler(MessageGroupProcessor processor, MessageGroupStore store, CorrelationStrategy correlationStrategy, ReleaseStrategy releaseStrategy) -
AggregatingMessageHandler
-
AggregatingMessageHandler
-
-
Method Details
-
setExpireGroupsUponCompletion
public void setExpireGroupsUponCompletion(boolean expireGroupsUponCompletion)Will set the 'expireGroupsUponCompletion' flag.- Parameters:
expireGroupsUponCompletion
- true when groups should be expired on completion.- See Also:
afterRelease(org.springframework.integration.store.MessageGroup, java.util.Collection<org.springframework.messaging.Message<?>>)
-
getIntegrationPatternType
Description copied from interface:IntegrationPattern
Return a pattern type this component implements.- Specified by:
getIntegrationPatternType
in interfaceIntegrationPattern
- Overrides:
getIntegrationPatternType
in classMessageHandlerSupport
- Returns:
- the
IntegrationPatternType
this component implements.
-
isExpireGroupsUponCompletion
protected boolean isExpireGroupsUponCompletion()- Overrides:
isExpireGroupsUponCompletion
in classAbstractCorrelatingMessageHandler
-
afterRelease
Complete the group and remove all its messages. If theexpireGroupsUponCompletion
is true, then remove group fully.- Specified by:
afterRelease
in classAbstractCorrelatingMessageHandler
- Parameters:
messageGroup
- the group to clean up.completedMessages
- The completed messages. Ignored in this implementation.
-