public class ApplicationEventPublishingMessageHandler extends AbstractMessageHandler implements ApplicationEventPublisherAware
MessageHandler
that publishes each Message
it receives as a MessagingEvent
. The MessagingEvent
is a subclass of
Spring's ApplicationEvent
used by this adapter to simply wrap the
Message
.
If the publishPayload
flag is specified to true
, the payload
will be published as is without wrapping to any ApplicationEvent
.
IntegrationManagement.ManagementOverrides
EXPRESSION_PARSER, logger
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME
Constructor and Description |
---|
ApplicationEventPublishingMessageHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
handleMessageInternal(Message<?> message) |
void |
setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) |
void |
setPublishPayload(boolean publishPayload)
Specify if
payload should be published as is
or the whole message must be wrapped to the MessagingEvent . |
handleMessage, onComplete, onError, onNext, onSubscribe
buildSendTimer, destroy, getComponentType, getIntegrationPatternType, 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, onInit, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getThisAs
getBeanName, getComponentName
public ApplicationEventPublishingMessageHandler()
public void setPublishPayload(boolean publishPayload)
payload
should be published as is
or the whole message
must be wrapped to the MessagingEvent
.publishPayload
- the boolean
flag to wrap the message
to the MessagingEvent
or publish payload
as is. Defaults to false
.ApplicationEventPublisher.publishEvent(Object)
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher
in interface ApplicationEventPublisherAware
protected void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler