public class MessageTransformingHandler extends AbstractReplyProducingMessageHandler implements ManageableLifecycle
MessageHandler
that delegates to a Transformer
instance to modify the received Message
and sends the result to its output channel.AbstractReplyProducingMessageHandler.RequestHandler
IntegrationManagement.ManagementOverrides
messagingTemplate
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
MessageTransformingHandler(Transformer transformer)
Create a
MessageTransformingHandler instance that delegates to
the provided Transformer . |
Modifier and Type | Method and Description |
---|---|
void |
addNotPropagatedHeaders(String... headers)
Add header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy")
that will NOT be copied from the inbound message if
AbstractMessageProducingHandler.shouldCopyRequestHeaders() is true, instead of overwriting the existing
set. |
protected void |
doInit() |
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
IntegrationPatternType |
getIntegrationPatternType()
Return a pattern type this component implements.
|
protected Object |
handleRequestMessage(Message<?> message)
Subclasses must implement this method to handle the request Message.
|
boolean |
isRunning() |
protected boolean |
shouldCopyRequestHeaders()
Subclasses may override this.
|
void |
start() |
void |
stop() |
doInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReply
createOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, shouldSplitOutput, updateNotPropagatedHeaders
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getOrder, getOverrides, isLoggingEnabled, registerMetricsCaptor, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrack
afterPropertiesSet, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public MessageTransformingHandler(Transformer transformer)
MessageTransformingHandler
instance that delegates to
the provided Transformer
.transformer
- The transformer.public String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class MessageHandlerSupport
public IntegrationPatternType getIntegrationPatternType()
IntegrationPattern
getIntegrationPatternType
in interface IntegrationPattern
getIntegrationPatternType
in class AbstractReplyProducingMessageHandler
IntegrationPatternType
this component implements.public void addNotPropagatedHeaders(String... headers)
AbstractMessageProducingHandler
AbstractMessageProducingHandler.shouldCopyRequestHeaders()
is true, instead of overwriting the existing
set.addNotPropagatedHeaders
in interface HeaderPropagationAware
addNotPropagatedHeaders
in class AbstractMessageProducingHandler
headers
- the headers to not propagate from the inbound message.AbstractMessageProducingHandler.setNotPropagatedHeaders(String...)
protected void doInit()
doInit
in class AbstractReplyProducingMessageHandler
public void start()
start
in interface Lifecycle
start
in interface ManageableLifecycle
public void stop()
stop
in interface Lifecycle
stop
in interface ManageableLifecycle
public boolean isRunning()
isRunning
in interface Lifecycle
isRunning
in interface ManageableLifecycle
protected Object handleRequestMessage(Message<?> message)
AbstractReplyProducingMessageHandler
handleRequestMessage
in class AbstractReplyProducingMessageHandler
message
- The request message.null
.protected boolean shouldCopyRequestHeaders()
AbstractMessageProducingHandler
shouldCopyRequestHeaders
in class AbstractMessageProducingHandler