Class SimpleAmqpHeaderMapper

java.lang.Object
org.springframework.messaging.support.AbstractHeaderMapper<MessageProperties>
org.springframework.amqp.support.SimpleAmqpHeaderMapper
All Implemented Interfaces:
AmqpHeaderMapper, org.springframework.messaging.support.HeaderMapper<MessageProperties>

public class SimpleAmqpHeaderMapper extends org.springframework.messaging.support.AbstractHeaderMapper<MessageProperties> implements AmqpHeaderMapper
Simple implementation of AmqpHeaderMapper.

This implementation copies AMQP API headers (e.g. appId) to and from MessageHeaders.Any used-defined properties will also be copied from an AMQP Message to a Message, and any other headers on a Message (beyond the AMQP headers) will likewise be copied to an AMQP Message. Those other headers will be copied to the general headers of a MessageProperties whereas the AMQP API headers are passed to the appropriate setter methods (e.g. MessageProperties.setAppId(java.lang.String).

Constants for the AMQP header keys are defined in AmqpHeaders.

Since:
1.4
  • Field Summary

    Fields inherited from class org.springframework.messaging.support.AbstractHeaderMapper

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fromHeaders(org.springframework.messaging.MessageHeaders headers, MessageProperties amqpMessageProperties)
     
    org.springframework.messaging.MessageHeaders
    toHeaders(MessageProperties amqpMessageProperties)
     

    Methods inherited from class org.springframework.messaging.support.AbstractHeaderMapper

    fromHeaderName, getHeaderIfAvailable, setInboundPrefix, setOutboundPrefix, toHeaderName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleAmqpHeaderMapper

      public SimpleAmqpHeaderMapper()
  • Method Details

    • fromHeaders

      public void fromHeaders(org.springframework.messaging.MessageHeaders headers, MessageProperties amqpMessageProperties)
      Specified by:
      fromHeaders in interface org.springframework.messaging.support.HeaderMapper<MessageProperties>
    • toHeaders

      public org.springframework.messaging.MessageHeaders toHeaders(MessageProperties amqpMessageProperties)
      Specified by:
      toHeaders in interface org.springframework.messaging.support.HeaderMapper<MessageProperties>