public class ContentEnricher extends AbstractReplyProducingMessageHandler implements org.springframework.context.Lifecycle
AbstractReplyProducingMessageHandler.RequestHandlerIntegrationManagement.ManagementOverridesmessagingTemplateEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
ContentEnricher() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doInit()
Initializes the Content Enricher.
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
protected java.lang.Object |
handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
Subclasses must implement this method to handle the request Message.
|
boolean |
isRunning()
Lifecycle implementation.
|
void |
setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)
Set the content enricher's error channel to allow the error handling flow to return
of an alternative object to use for enrichment if exceptions occur in the
downstream flow.
|
void |
setErrorChannelName(java.lang.String errorChannelName) |
void |
setHeaderExpressions(java.util.Map<java.lang.String,HeaderValueMessageProcessor<?>> headerExpressions)
Provide the map of
HeaderValueMessageProcessor to evaluate when enriching
the target MessageHeaders. |
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
void |
setNullResultHeaderExpressions(java.util.Map<java.lang.String,HeaderValueMessageProcessor<?>> nullResultHeaderExpressions) |
void |
setNullResultPropertyExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> nullResultPropertyExpressions) |
void |
setPropertyExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> propertyExpressions)
Provide the map of expressions to evaluate when enriching the target payload.
|
void |
setReplyChannel(org.springframework.messaging.MessageChannel replyChannel)
Sets the content enricher's reply channel.
|
void |
setReplyChannelName(java.lang.String replyChannelName) |
void |
setReplyTimeout(java.lang.Long replyTimeout)
Set the timeout value for receiving reply messages.
|
void |
setRequestChannel(org.springframework.messaging.MessageChannel requestChannel)
Sets the content enricher's request channel.
|
void |
setRequestChannelName(java.lang.String requestChannelName) |
void |
setRequestPayloadExpression(org.springframework.expression.Expression requestPayloadExpression)
By default the original message's payload will be used as the actual payload that
will be send to the request-channel.
|
void |
setRequestTimeout(java.lang.Long requestTimeout)
Set the timeout value for sending request messages.
|
void |
setShouldClonePayload(boolean shouldClonePayload)
Specify whether to clone payload objects to create the target object.
|
void |
start()
Lifecycle implementation.
|
void |
stop()
Lifecycle implementation.
|
doInvokeAdvisedRequestHandler, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyaddNotPropagatedHeaders, createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldCopyRequestHeaders, shouldSplitOutput, updateNotPropagatedHeadersconfigureMetrics, getActiveCount, getActiveCountLong, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onNext, onSubscribe, registerMetricsCaptor, 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, waitgetComponentNamepublic void setNullResultPropertyExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> nullResultPropertyExpressions)
public void setNullResultHeaderExpressions(java.util.Map<java.lang.String,HeaderValueMessageProcessor<?>> nullResultHeaderExpressions)
public void setPropertyExpressions(java.util.Map<java.lang.String,org.springframework.expression.Expression> propertyExpressions)
propertyExpressions - The property expressions.public void setHeaderExpressions(java.util.Map<java.lang.String,HeaderValueMessageProcessor<?>> headerExpressions)
HeaderValueMessageProcessor to evaluate when enriching
the target MessageHeaders. The keys should simply be header names, and the values
should be Expressions that will evaluate against the reply Message as the root
object.headerExpressions - The header expressions.public void setRequestChannel(org.springframework.messaging.MessageChannel requestChannel)
requestChannel - The request channel.public void setRequestChannelName(java.lang.String requestChannelName)
public void setReplyChannel(org.springframework.messaging.MessageChannel replyChannel)
replyChannel - The reply channel.public void setReplyChannelName(java.lang.String replyChannelName)
public void setErrorChannel(org.springframework.messaging.MessageChannel errorChannel)
errorChannel - The error channel.public void setErrorChannelName(java.lang.String errorChannelName)
public void setRequestTimeout(java.lang.Long requestTimeout)
requestTimeout - the timeout value in milliseconds. Must not be null.public void setReplyTimeout(java.lang.Long replyTimeout)
replyTimeout - the timeout value in milliseconds. Must not be null.public void setRequestPayloadExpression(org.springframework.expression.Expression requestPayloadExpression)
By providing a SpEL expression as value for this setter, a subset of the original payload, a header value or any other resolvable SpEL expression can be used as the basis for the payload, that will be send to the request-channel.
For the Expression evaluation the full message is available as the root object.
For instance the following SpEL expressions (among others) are possible:
If more sophisticated logic is required (e.g. changing the message headers etc.) please use additional downstream transformers.
requestPayloadExpression - The request payload expression.public void setShouldClonePayload(boolean shouldClonePayload)
shouldClonePayload - true if the payload should be cloned.public void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
public java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class AbstractMessageHandlerprotected void doInit()
doInit in class AbstractReplyProducingMessageHandlerprotected java.lang.Object handleRequestMessage(org.springframework.messaging.Message<?> requestMessage)
AbstractReplyProducingMessageHandlerhandleRequestMessage in class AbstractReplyProducingMessageHandlerrequestMessage - The request message.null.public void start()
start in interface org.springframework.context.Lifecyclepublic void stop()
stop in interface org.springframework.context.Lifecyclepublic boolean isRunning()
isRunning in interface org.springframework.context.Lifecycle