public abstract class AbstractMessageSplitter extends AbstractReplyProducingMessageHandler implements DiscardingMessageHandler
AbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
AbstractMessageSplitter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addHeaders(org.springframework.messaging.Message<?> message,
java.util.Map<java.lang.String,java.lang.Object> headers)
Allows subclasses to add extra headers to the output messages.
|
protected void |
doInit() |
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
org.springframework.messaging.MessageChannel |
getDiscardChannel()
Return the discard channel.
|
IntegrationPatternType |
getIntegrationPatternType()
Return a pattern type this component implements.
|
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> message)
Subclasses must implement this method to handle the request Message.
|
protected int |
obtainSizeIfPossible(java.lang.Iterable<?> iterable)
Obtain a size of the provided
Iterable. |
protected int |
obtainSizeIfPossible(java.util.Iterator<?> iterator)
Obtain a size of the provided
Iterator. |
protected void |
produceOutput(java.lang.Object result,
org.springframework.messaging.Message<?> requestMessage) |
void |
setApplySequence(boolean applySequence)
Set the applySequence flag to the specified value.
|
void |
setDiscardChannel(org.springframework.messaging.MessageChannel discardChannel)
Specify a channel where rejected Messages should be sent.
|
void |
setDiscardChannelName(java.lang.String discardChannelName)
Specify a channel bean name (resolved to
MessageChannel lazily)
where rejected Messages should be sent. |
protected boolean |
shouldCopyRequestHeaders()
Subclasses may override this.
|
protected abstract java.lang.Object |
splitMessage(org.springframework.messaging.Message<?> message)
Subclasses must override this method to split the received Message.
|
protected boolean |
willAddHeaders(org.springframework.messaging.Message<?> message)
Return true if the subclass needs to add headers in the resulting splits.
|
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldSplitOutput, updateNotPropagatedHeadershandleMessage, onComplete, onError, onNext, onSubscribebuildSendTimer, configureMetrics, destroy, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getHandlerMetrics, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMetricsCaptor, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, isCountsEnabled, isLoggingEnabled, isStatsEnabled, registerMetricsCaptor, reset, sendTimer, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabled, 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, waiterrorCount, handleCountgetBeanName, getComponentNamepublic void setApplySequence(boolean applySequence)
applySequence - true to apply sequence information.public void setDiscardChannel(org.springframework.messaging.MessageChannel discardChannel)
discardChannel - The discard channel.public void setDiscardChannelName(java.lang.String discardChannelName)
MessageChannel lazily)
where rejected Messages should be sent. If the discard
channel is null (the default), rejected Messages will be dropped.
A "Rejected Message" means that split function has returned an empty result (but not null):
no items to iterate for sending.discardChannelName - The discard channel bean name.public org.springframework.messaging.MessageChannel getDiscardChannel()
DiscardingMessageHandlergetDiscardChannel in interface DiscardingMessageHandlerpublic IntegrationPatternType getIntegrationPatternType()
IntegrationPatterngetIntegrationPatternType in interface IntegrationPatterngetIntegrationPatternType in class AbstractReplyProducingMessageHandlerIntegrationPatternType this component implements.protected void doInit()
doInit in class AbstractReplyProducingMessageHandlerprotected final java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> message)
AbstractReplyProducingMessageHandlerhandleRequestMessage in class AbstractReplyProducingMessageHandlermessage - The request message.null.protected int obtainSizeIfPossible(java.lang.Iterable<?> iterable)
Iterable. Default implementation returns
Collection.size() if the iterable is a collection, or 0 otherwise.
If iterable is a Jackson TreeNode, then its size is used.iterable - the Iterable to obtain the sizeIterableprotected int obtainSizeIfPossible(java.util.Iterator<?> iterator)
Iterator.
Default implementation returns 0.iterator - the Iterator to obtain the sizeIteratorprotected boolean willAddHeaders(org.springframework.messaging.Message<?> message)
addHeaders(org.springframework.messaging.Message<?>, java.util.Map<java.lang.String, java.lang.Object>) will be called.message - the message.protected void addHeaders(org.springframework.messaging.Message<?> message,
java.util.Map<java.lang.String,java.lang.Object> headers)
message - the inbound message.headers - the headers to add messages to.protected boolean shouldCopyRequestHeaders()
AbstractMessageProducingHandlershouldCopyRequestHeaders in class AbstractMessageProducingHandlerprotected void produceOutput(java.lang.Object result,
org.springframework.messaging.Message<?> requestMessage)
produceOutput in class AbstractMessageProducingHandlerpublic java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class MessageHandlerSupportprotected abstract java.lang.Object splitMessage(org.springframework.messaging.Message<?> message)
message - The message.