public class BarrierMessageHandler extends AbstractReplyProducingMessageHandler implements MessageTriggerAction, DiscardingMessageHandler
trigger method or
the timeout occurs. Only one thread with a particular correlation (result of invoking
the CorrelationStrategy) can be suspended at a time. If the inbound thread does
not arrive before the trigger thread, the latter is suspended until it does, or the
timeout occurs. Separate timeouts may be configured for request and trigger messages.
The default CorrelationStrategy is a HeaderAttributeCorrelationStrategy.
The default output processor is a DefaultAggregatingMessageGroupProcessor.
AbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerHIGHEST_PRECEDENCE, LOWEST_PRECEDENCEMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
BarrierMessageHandler(long timeout)
Construct an instance with the provided timeout and default correlation and
output strategies.
|
BarrierMessageHandler(long timeout,
CorrelationStrategy correlationStrategy)
Construct an instance with the provided timeout and correlation strategy, and default
output processor.
|
BarrierMessageHandler(long requestTimeout,
long triggerTimeout)
Construct an instance with the provided timeouts and default correlation and
output strategies.
|
BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
CorrelationStrategy correlationStrategy)
Construct an instance with the provided timeout and correlation strategy, and default
output processor.
|
BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
MessageGroupProcessor outputProcessor)
Construct an instance with the provided timeout and output processor, and default
correlation strategy.
|
BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
MessageGroupProcessor outputProcessor,
CorrelationStrategy correlationStrategy)
Construct an instance with the provided timeout and output processor, and default
correlation strategy.
|
BarrierMessageHandler(long timeout,
MessageGroupProcessor outputProcessor)
Construct an instance with the provided timeout and output processor, and default
correlation strategy.
|
BarrierMessageHandler(long timeout,
MessageGroupProcessor outputProcessor,
CorrelationStrategy correlationStrategy)
Construct an instance with the provided timeout and output processor, and default
correlation strategy.
|
| Modifier and Type | Method and Description |
|---|---|
protected Object |
buildResult(Object key,
Message<?> requestMessage,
Message<?> releaseMessage)
Override to change the default mechanism by which the inbound and release messages
are returned as a result.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
MessageChannel |
getDiscardChannel()
Return the discard channel.
|
IntegrationPatternType |
getIntegrationPatternType()
Return a pattern type this component implements.
|
protected Object |
handleRequestMessage(Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
void |
setDiscardChannel(MessageChannel discardChannel)
Set the channel to which late arriving trigger messages are sent.
|
void |
setDiscardChannelName(String discardChannelName)
Set the name of the channel to which late arriving trigger messages are sent.
|
void |
trigger(Message<?> message)
Take some action based on the message.
|
doInit, doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadershandleMessage, onComplete, onError, onNext, onSubscribebuildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackafterPropertiesSet, 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, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithandleMessagegetThisAsgetBeanName, getComponentNamepublic BarrierMessageHandler(long timeout)
timeout - the timeout in milliseconds for both, request and trigger messages.public BarrierMessageHandler(long timeout,
MessageGroupProcessor outputProcessor)
timeout - the timeout in milliseconds for both, request and trigger messages.outputProcessor - the output MessageGroupProcessor.public BarrierMessageHandler(long timeout,
CorrelationStrategy correlationStrategy)
timeout - the timeout in milliseconds for both, request and trigger messages.correlationStrategy - the correlation strategy.public BarrierMessageHandler(long timeout,
MessageGroupProcessor outputProcessor,
CorrelationStrategy correlationStrategy)
timeout - the timeout in milliseconds for both, request and trigger messages.outputProcessor - the output MessageGroupProcessor.correlationStrategy - the correlation strategy.public BarrierMessageHandler(long requestTimeout,
long triggerTimeout)
requestTimeout - the timeout in milliseconds when waiting for trigger message.triggerTimeout - the timeout in milliseconds when waiting for a request message.public BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
MessageGroupProcessor outputProcessor)
requestTimeout - the timeout in milliseconds when waiting for trigger message.triggerTimeout - the timeout in milliseconds when waiting for a request message.outputProcessor - the output MessageGroupProcessor.public BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
CorrelationStrategy correlationStrategy)
requestTimeout - the timeout in milliseconds when waiting for trigger message.triggerTimeout - the timeout in milliseconds when waiting for a request message.correlationStrategy - the correlation strategy.public BarrierMessageHandler(long requestTimeout,
long triggerTimeout,
MessageGroupProcessor outputProcessor,
CorrelationStrategy correlationStrategy)
requestTimeout - the timeout in milliseconds when waiting for trigger message.triggerTimeout - the timeout in milliseconds when waiting for a request message.outputProcessor - the output MessageGroupProcessor.correlationStrategy - the correlation strategy.public void setDiscardChannelName(String discardChannelName)
discardChannelName - the discard channel.public void setDiscardChannel(MessageChannel discardChannel)
discardChannel - the discard channel.public MessageChannel getDiscardChannel()
DiscardingMessageHandlergetDiscardChannel in interface DiscardingMessageHandlerpublic String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class MessageHandlerSupportpublic IntegrationPatternType getIntegrationPatternType()
IntegrationPatterngetIntegrationPatternType in interface IntegrationPatterngetIntegrationPatternType in class AbstractReplyProducingMessageHandlerIntegrationPatternType this component implements.protected Object handleRequestMessage(Message<?> requestMessage)
AbstractReplyProducingMessageHandlerhandleRequestMessage in class AbstractReplyProducingMessageHandlerrequestMessage - The request message.null.protected Object buildResult(Object key, Message<?> requestMessage, Message<?> releaseMessage)
key - The correlation key.requestMessage - the inbound message.releaseMessage - the release message.public void trigger(Message<?> message)
MessageTriggerActiontrigger in interface MessageTriggerActionmessage - the message.