Class PayloadTypeRouter

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

public class PayloadTypeRouter extends AbstractMappingMessageRouter
A Message Router that resolves the MessageChannel based on the Message's payload type.
Author:
Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan
  • Constructor Details

    • PayloadTypeRouter

      public PayloadTypeRouter()
  • Method Details

    • getChannelKeys

      protected List<Object> getChannelKeys(Message<?> message)
      Selects the most appropriate channel name matching channel identifiers which are the fully qualified class names encountered while traversing the payload type hierarchy. To resolve ties and conflicts (e.g., Serializable and String) it will match: 1. Type name to channel identifier else... 2. Name of the subclass of the type to channel identifier else... 3. Name of the Interface of the type to channel identifier while also preferring direct interface over indirect subclass
      Specified by:
      getChannelKeys in class AbstractMappingMessageRouter
      Parameters:
      message - The message.
      Returns:
      The channel keys.