Class HeaderValueRouter

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

public class HeaderValueRouter
extends AbstractMappingMessageRouter
A Message Router that resolves the MessageChannel from a header value.
Since:
1.0.3
  • Constructor Details

    • HeaderValueRouter

      public HeaderValueRouter​(java.lang.String headerName)
      Create a router that uses the provided header name to lookup a channel.
      Parameters:
      headerName - The header name.
  • Method Details

    • getChannelKeys

      protected java.util.List<java.lang.Object> getChannelKeys​(org.springframework.messaging.Message<?> message)
      Description copied from class: AbstractMappingMessageRouter
      Subclasses must implement this method to return the channel keys. A "key" might be present in this router's "channelMappings", or it could be the channel's name or even the Message Channel instance itself.
      Specified by:
      getChannelKeys in class AbstractMappingMessageRouter
      Parameters:
      message - The message.
      Returns:
      The channel keys.