public abstract class AbstractMessageProducingHandler extends AbstractMessageHandler implements MessageProducer, HeaderPropagationAware
AbstractMessageHandler implementation for the MessageProducer.| Modifier and Type | Field and Description |
|---|---|
protected MessagingTemplate |
messagingTemplate |
EXPRESSION_PARSER, logger| Constructor and Description |
|---|
AbstractMessageProducingHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotPropagatedHeaders(String... headers)
Add headers that will NOT be copied from the inbound message if
shouldCopyRequestHeaders() is true, instead of overwriting the existing
set. |
protected org.springframework.messaging.Message<?> |
createOutputMessage(Object output,
org.springframework.messaging.MessageHeaders requestHeaders) |
Collection<String> |
getNotPropagatedHeaders()
Get the header names this handler doesn't propagate.
|
org.springframework.messaging.MessageChannel |
getOutputChannel()
Return the the output channel.
|
protected boolean |
isAsync() |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
protected void |
produceOutput(Object reply,
org.springframework.messaging.Message<?> requestMessage) |
protected Object |
resolveErrorChannel(org.springframework.messaging.MessageHeaders requestHeaders) |
protected void |
sendErrorMessage(org.springframework.messaging.Message<?> requestMessage,
Throwable ex) |
protected void |
sendOutput(Object output,
Object replyChannel,
boolean useArgChannel)
Send an output Message.
|
protected void |
sendOutputs(Object result,
org.springframework.messaging.Message<?> requestMessage) |
void |
setAsync(boolean async)
Allow async replies.
|
void |
setNotPropagatedHeaders(String... headers)
Set headers that will NOT be copied from the inbound message if
shouldCopyRequestHeaaders is true. |
void |
setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)
Specify the MessageChannel to which produced Messages should be sent.
|
void |
setOutputChannelName(String outputChannelName) |
void |
setSendTimeout(long sendTimeout)
Set the timeout for sending reply Messages.
|
protected boolean |
shouldCopyRequestHeaders()
Subclasses may override this.
|
protected boolean |
shouldSplitOutput(Iterable<?> reply) |
configureMetrics, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getStandardDeviationDuration, handleMessage, handleMessageInternal, isCountsEnabled, isLoggingEnabled, isStatsEnabled, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNameprotected final MessagingTemplate messagingTemplate
public void setSendTimeout(long sendTimeout)
sendTimeout - The send timeout.public void setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)
MessageProducersetOutputChannel in interface MessageProduceroutputChannel - The output channel.public void setOutputChannelName(String outputChannelName)
public final void setAsync(boolean async)
ListenableFuture send
the output when it is satisfied rather than sending the future as the result.
Only subclasses that support this feature should set it.async - true to allow.protected boolean isAsync()
setAsync(boolean)public void setNotPropagatedHeaders(String... headers)
shouldCopyRequestHeaaders is true.setNotPropagatedHeaders in interface HeaderPropagationAwareheaders - the headers to not propagate from the inbound message.public Collection<String> getNotPropagatedHeaders()
getNotPropagatedHeaders in interface HeaderPropagationAwareCollection of headers that will not be
copied from the inbound message if shouldCopyRequestHeaders() is true.setNotPropagatedHeaders(String...)public void addNotPropagatedHeaders(String... headers)
shouldCopyRequestHeaders() is true, instead of overwriting the existing
set.addNotPropagatedHeaders in interface HeaderPropagationAwareheaders - the headers to not propagate from the inbound message.setNotPropagatedHeaders(String...)protected void onInit()
throws Exception
IntegrationObjectSupportonInit in class AbstractMessageHandlerException - Any exception.public org.springframework.messaging.MessageChannel getOutputChannel()
MessageProducergetOutputChannel in interface MessageProducerprotected void sendOutputs(Object result, org.springframework.messaging.Message<?> requestMessage)
protected boolean shouldSplitOutput(Iterable<?> reply)
protected void produceOutput(Object reply, org.springframework.messaging.Message<?> requestMessage)
protected org.springframework.messaging.Message<?> createOutputMessage(Object output, org.springframework.messaging.MessageHeaders requestHeaders)
protected void sendOutput(Object output, Object replyChannel, boolean useArgChannel)
null. In that case, the 'replyChannel' value must not also be
null, and it must be an instance of either String or MessageChannel.output - the output object to sendreplyChannel - the 'replyChannel' value from the original requestuseArgChannel - - use the replyChannel argument (must not be null), not
the configured output channel.protected boolean shouldCopyRequestHeaders()
protected void sendErrorMessage(org.springframework.messaging.Message<?> requestMessage,
Throwable ex)
protected Object resolveErrorChannel(org.springframework.messaging.MessageHeaders requestHeaders)