Class NotificationPublishingMessageHandler

All Implemented Interfaces:
org.reactivestreams.Subscriber<Message<?>>, Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Ordered, ExpressionCapable, Orderable, IntegrationPattern, NamedComponent, IntegrationManagement, TrackableComponent, MessageHandler, reactor.core.CoreSubscriber<Message<?>>

public class NotificationPublishingMessageHandler extends AbstractMessageHandler
An AbstractMessageHandler implementation to publish an incoming message as a JMX Notification. The OutboundMessageMapper is used to convert a Message to the Notification.
Since:
2.0
Author:
Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan, Trung Pham
  • Constructor Details

    • NotificationPublishingMessageHandler

      public NotificationPublishingMessageHandler(ObjectName objectName)
      Construct an instance based on the provided object name.
      Parameters:
      objectName - the ObjectName to use for notification.
    • NotificationPublishingMessageHandler

      public NotificationPublishingMessageHandler(String objectName)
      Construct an instance based on the provided object name.
      Parameters:
      objectName - the object name to use for notification.
  • Method Details

    • setNotificationMapper

      public void setNotificationMapper(@Nullable OutboundMessageMapper<Notification> notificationMapper)
      Set a mapper for creating Notifications from a Message. If not provided, a default implementation will be used such that String-typed payloads will be passed as the 'message' of the Notification and all other payload types will be passed as the 'userData' of the Notification.
      Parameters:
      notificationMapper - The notification mapper.
    • setDefaultNotificationType

      public void setDefaultNotificationType(String defaultNotificationType)
      Specify a dot-delimited String representing the Notification type to use by default when no explicit Notification mapper has been configured. If not provided, then a notification type header will be required for each message being mapped into a Notification.
      Parameters:
      defaultNotificationType - The default notification type.
    • getComponentType

      public String getComponentType()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this method to provide component type information.
      Specified by:
      getComponentType in interface NamedComponent
      Overrides:
      getComponentType in class MessageHandlerSupport
    • onInit

      public final void onInit()
      Description copied from class: IntegrationObjectSupport
      Subclasses may implement this for initialization logic.
      Overrides:
      onInit in class IntegrationObjectSupport
    • handleMessageInternal

      protected void handleMessageInternal(Message<?> message)
      Specified by:
      handleMessageInternal in class AbstractMessageHandler