public abstract class AbstractMessageProducingHandler extends AbstractMessageHandler implements MessageProducer
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 |
|---|---|
protected org.springframework.messaging.Message<?> |
createOutputMessage(java.lang.Object output,
org.springframework.messaging.MessageHeaders requestHeaders) |
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(java.lang.Object reply,
org.springframework.messaging.Message<?> requestMessage) |
protected java.lang.Object |
resolveErrorChannel(org.springframework.messaging.MessageHeaders requestHeaders) |
protected void |
sendErrorMessage(org.springframework.messaging.Message<?> requestMessage,
java.lang.Throwable ex) |
protected void |
sendOutput(java.lang.Object output,
java.lang.Object replyChannel,
boolean useArgChannel)
Send an output Message.
|
protected void |
sendOutputs(java.lang.Object result,
org.springframework.messaging.Message<?> requestMessage) |
void |
setAsync(boolean async)
Allow async replies.
|
void |
setOutputChannel(org.springframework.messaging.MessageChannel outputChannel)
Specify the MessageChannel to which produced Messages should be sent.
|
void |
setOutputChannelName(java.lang.String outputChannelName) |
void |
setSendTimeout(long sendTimeout)
Set the timeout for sending reply Messages.
|
protected boolean |
shouldCopyRequestHeaders()
Subclasses may override this.
|
protected boolean |
shouldSplitOutput(java.lang.Iterable<?> reply) |
configureMetrics, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getStandardDeviationDuration, handleMessage, handleMessageInternal, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, 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(java.lang.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)protected void onInit()
throws java.lang.Exception
IntegrationObjectSupportonInit in class AbstractMessageHandlerjava.lang.Exception - Any exception.public org.springframework.messaging.MessageChannel getOutputChannel()
MessageProducergetOutputChannel in interface MessageProducerprotected void sendOutputs(java.lang.Object result,
org.springframework.messaging.Message<?> requestMessage)
protected boolean shouldSplitOutput(java.lang.Iterable<?> reply)
protected void produceOutput(java.lang.Object reply,
org.springframework.messaging.Message<?> requestMessage)
protected org.springframework.messaging.Message<?> createOutputMessage(java.lang.Object output,
org.springframework.messaging.MessageHeaders requestHeaders)
protected void sendOutput(java.lang.Object output,
java.lang.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,
java.lang.Throwable ex)
protected java.lang.Object resolveErrorChannel(org.springframework.messaging.MessageHeaders requestHeaders)