org.springframework.integration.amqp.support
Class DefaultAmqpHeaderMapper

java.lang.Object
  extended by org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper
All Implemented Interfaces:
AmqpHeaderMapper, HeaderMapper<org.springframework.amqp.core.MessageProperties>

public class DefaultAmqpHeaderMapper
extends java.lang.Object
implements AmqpHeaderMapper

Default implementation of AmqpHeaderMapper.

This implementation copies AMQP properties (e.g. contentType) to and from Spring Integration MessageHeaders. Any user-defined headers within the AMQP MessageProperties will also be copied from an AMQP Message to a Spring Integration Message, and any other headers on a Spring Integration Message (beyond the standard AMQP properties) will likewise be copied to an AMQP Message.

Constants for the AMQP header keys are defined in AmqpHeaders.

Since:
2.1

Constructor Summary
DefaultAmqpHeaderMapper()
           
 
Method Summary
 void fromHeaders(MessageHeaders headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties)
          Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.
 void setInboundPrefix(java.lang.String inboundPrefix)
          Specify a prefix to be appended to the integration message header name for any user-defined AMQP header that is being mapped into the MessageHeaders.
 void setOutboundPrefix(java.lang.String outboundPrefix)
          Specify a prefix to be appended to the AMQP header name for any integration message header that is being mapped into the AMQP Message.
 java.util.Map<java.lang.String,java.lang.Object> toHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
          Maps headers from an AMQP MessageProperties instance to the MessageHeaders of a Spring Integration Message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAmqpHeaderMapper

public DefaultAmqpHeaderMapper()
Method Detail

setInboundPrefix

public void setInboundPrefix(java.lang.String inboundPrefix)
Specify a prefix to be appended to the integration message header name for any user-defined AMQP header that is being mapped into the MessageHeaders. The Default is an empty string (no prefix).

This does not affect the standard AMQP properties, such as contentType, etc. The header names used for mapping such properties are all defined in the AmqpHeaders class as constants.


setOutboundPrefix

public void setOutboundPrefix(java.lang.String outboundPrefix)
Specify a prefix to be appended to the AMQP header name for any integration message header that is being mapped into the AMQP Message. The Default is an empty string (no prefix).

This does not affect the standard AMQP properties, such as contentType, etc. The header names used for mapping such properties are all defined in the AmqpHeaders class as constants.


fromHeaders

public void fromHeaders(MessageHeaders headers,
                        org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.

Specified by:
fromHeaders in interface HeaderMapper<org.springframework.amqp.core.MessageProperties>

toHeaders

public java.util.Map<java.lang.String,java.lang.Object> toHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Maps headers from an AMQP MessageProperties instance to the MessageHeaders of a Spring Integration Message.

Specified by:
toHeaders in interface HeaderMapper<org.springframework.amqp.core.MessageProperties>