public class ApplicationEventPublishingMessageHandler extends AbstractMessageHandler implements org.springframework.context.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.ManagementOverridesEXPRESSION_PARSER, loggerMETER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAME| Constructor and Description |
|---|
ApplicationEventPublishingMessageHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
handleMessageInternal(org.springframework.messaging.Message<?> message) |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher) |
void |
setPublishPayload(boolean publishPayload)
Specify if
payload should be published as is
or the whole message must be wrapped to the MessagingEvent. |
configureMetrics, getActiveCount, getActiveCountLong, getComponentType, getDuration, getErrorCount, getErrorCountLong, getHandleCount, getHandleCountLong, getManagedName, getManagedType, getMaxDuration, getMeanDuration, getMinDuration, getOrder, getOverrides, getStandardDeviationDuration, handleMessage, isCountsEnabled, isLoggingEnabled, isStatsEnabled, onComplete, onError, onInit, onNext, onSubscribe, registerMetricsCaptor, reset, setCountsEnabled, setLoggingEnabled, setManagedName, setManagedType, setOrder, setShouldTrack, setStatsEnabledafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic 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(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
setApplicationEventPublisher in interface org.springframework.context.ApplicationEventPublisherAwareprotected void handleMessageInternal(org.springframework.messaging.Message<?> message)
handleMessageInternal in class AbstractMessageHandler