Class MessageTransformingHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.MessageHandlerSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.AbstractMessageProducingHandler
org.springframework.integration.handler.AbstractReplyProducingMessageHandler
org.springframework.integration.transformer.MessageTransformingHandler
- All Implemented Interfaces:
- org.reactivestreams.Subscriber<Message<?>>,- Aware,- BeanClassLoaderAware,- BeanFactoryAware,- BeanNameAware,- DisposableBean,- InitializingBean,- ApplicationContextAware,- Lifecycle,- Ordered,- ComponentSourceAware,- ExpressionCapable,- Orderable,- MessageProducer,- HeaderPropagationAware,- IntegrationPattern,- NamedComponent,- IntegrationManagement,- ManageableLifecycle,- TrackableComponent,- MessageHandler,- reactor.core.CoreSubscriber<Message<?>>
public class MessageTransformingHandler
extends AbstractReplyProducingMessageHandler
implements ManageableLifecycle
A reply-producing 
MessageHandler
 that delegates to a Transformer instance to modify the received Message
 and sends the result to its output channel.- Author:
- Mark Fisher, Oleg Zhurakousky, Artem Bilan, Gary Russell
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerAbstractReplyProducingMessageHandler.RequestHandlerNested classes/interfaces inherited from interface org.springframework.integration.support.management.IntegrationManagementIntegrationManagement.ManagementOverrides
- 
Field SummaryFields inherited from class org.springframework.integration.handler.AbstractMessageProducingHandlermessagingTemplateFields inherited from class org.springframework.integration.context.IntegrationObjectSupportEXPRESSION_PARSER, loggerFields inherited from interface org.springframework.integration.support.management.IntegrationManagementMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionCreate aMessageTransformingHandlerinstance.MessageTransformingHandler(Transformer transformer) Create aMessageTransformingHandlerinstance that delegates to the providedTransformer.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddNotPropagatedHeaders(String... headers) Add header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy") that will NOT be copied from the inbound message ifAbstractMessageProducingHandler.shouldCopyRequestHeaders()is true, instead of overwriting the existing set.protected voiddoInit()Return a pattern type this component implements.protected ObjecthandleRequestMessage(Message<?> message) Subclasses must implement this method to handle the request Message.booleanvoidsetTransformer(Transformer transformer) Provide aTransformerdelegate.protected booleanSubclasses may override this.voidstart()voidstop()Methods inherited from class org.springframework.integration.handler.AbstractReplyProducingMessageHandlerdoInvokeAdvisedRequestHandler, getBeanClassLoader, getRequiresReply, handleMessageInternal, hasAdviceChain, onInit, setAdviceChain, setBeanClassLoader, setRequiresReplyMethods inherited from class org.springframework.integration.handler.AbstractMessageProducingHandlercreateOutputMessage, getNotPropagatedHeaders, getOutputChannel, isAsync, messageBuilderForReply, produceOutput, resolveErrorChannel, sendErrorMessage, sendOutput, sendOutputs, setAsync, setNotPropagatedHeaders, setOutputChannel, setOutputChannelName, setSendTimeout, setupMessageProcessor, shouldSplitOutput, updateNotPropagatedHeadersMethods inherited from class org.springframework.integration.handler.AbstractMessageHandlerhandleMessage, onComplete, onError, onNext, onSubscribe, setObservationConventionMethods inherited from class org.springframework.integration.handler.MessageHandlerSupportbuildSendTimer, destroy, getManagedName, getManagedType, getMetricsCaptor, getObservationRegistry, getOrder, getOverrides, isLoggingEnabled, isObserved, registerMetricsCaptor, registerObservationRegistry, sendTimer, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, shouldTrackMethods inherited from class org.springframework.integration.context.IntegrationObjectSupportafterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface reactor.core.CoreSubscribercurrentContextMethods inherited from interface org.springframework.integration.support.management.IntegrationManagementgetThisAsMethods inherited from interface org.springframework.integration.support.context.NamedComponentgetBeanName, getComponentName
- 
Constructor Details- 
MessageTransformingHandlerpublic MessageTransformingHandler()Create aMessageTransformingHandlerinstance. The target delegateTransformermust be provided then via setter.- Since:
- 6.2
 
- 
MessageTransformingHandlerCreate aMessageTransformingHandlerinstance that delegates to the providedTransformer.- Parameters:
- transformer- The transformer.
 
 
- 
- 
Method Details- 
setTransformerProvide aTransformerdelegate.- Parameters:
- transformer- the- Transformerto use.
- Since:
- 6.2
 
- 
getComponentType- Specified by:
- getComponentTypein interface- NamedComponent
- Overrides:
- getComponentTypein class- MessageHandlerSupport
 
- 
getIntegrationPatternTypeDescription copied from interface:IntegrationPatternReturn a pattern type this component implements.- Specified by:
- getIntegrationPatternTypein interface- IntegrationPattern
- Overrides:
- getIntegrationPatternTypein class- AbstractReplyProducingMessageHandler
- Returns:
- the IntegrationPatternTypethis component implements.
 
- 
addNotPropagatedHeadersDescription copied from class:AbstractMessageProducingHandlerAdd header patterns ("xxx*", "*xxx", "*xxx*" or "xxx*yyy") that will NOT be copied from the inbound message ifAbstractMessageProducingHandler.shouldCopyRequestHeaders()is true, instead of overwriting the existing set.- Specified by:
- addNotPropagatedHeadersin interface- HeaderPropagationAware
- Overrides:
- addNotPropagatedHeadersin class- AbstractMessageProducingHandler
- Parameters:
- headers- the headers do not propagate from the inbound message.
- See Also:
 
- 
doInitprotected void doInit()- Overrides:
- doInitin class- AbstractReplyProducingMessageHandler
 
- 
startpublic void start()- Specified by:
- startin interface- Lifecycle
- Specified by:
- startin interface- ManageableLifecycle
 
- 
stoppublic void stop()- Specified by:
- stopin interface- Lifecycle
- Specified by:
- stopin interface- ManageableLifecycle
 
- 
isRunningpublic boolean isRunning()- Specified by:
- isRunningin interface- Lifecycle
- Specified by:
- isRunningin interface- ManageableLifecycle
 
- 
handleRequestMessageDescription copied from class:AbstractReplyProducingMessageHandlerSubclasses must implement this method to handle the request Message. The return value may be a Message, a MessageBuilder, or any plain Object. The base class will handle the final creation of a reply Message from any of those starting points. If the return value is null, the Message flow will end here.- Specified by:
- handleRequestMessagein class- AbstractReplyProducingMessageHandler
- Parameters:
- message- The request message.
- Returns:
- The result of handling the message, or null.
 
- 
shouldCopyRequestHeadersprotected boolean shouldCopyRequestHeaders()Description copied from class:AbstractMessageProducingHandlerSubclasses may override this. True by default.- Overrides:
- shouldCopyRequestHeadersin class- AbstractMessageProducingHandler
- Returns:
- true if the request headers should be copied.
 
 
-