public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties> implements AmqpHeaderMapper
AmqpHeaderMapper
.
By default this implementation will only copy AMQP properties (e.g. contentType) to and from
Spring Integration MessageHeaders. Any user-defined headers within the AMQP
MessageProperties will NOT be copied to or from an AMQP Message unless
explicitly identified via 'requestHeaderNames' and/or 'replyHeaderNames'
(see AbstractHeaderMapper.setRequestHeaderNames(String[])
and AbstractHeaderMapper.setReplyHeaderNames(String[])
}
as well as 'mapped-request-headers' and 'mapped-reply-headers' attributes of the AMQP adapters).
If you need to copy all user-defined headers simply use wild-card character '*'.
Constants for the AMQP header keys are defined in AmqpHeaders
.
logger, STANDARD_REPLY_HEADER_NAME_PATTERN, STANDARD_REQUEST_HEADER_NAME_PATTERN
Constructor and Description |
---|
DefaultAmqpHeaderMapper() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
extractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Extract "standard" headers from an AMQP MessageProperties instance.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Extract user-defined headers from an AMQP MessageProperties instance.
|
protected java.lang.String |
getStandardHeaderPrefix()
Returns the list of standard REPLY headers.
|
protected java.util.List<java.lang.String> |
getStandardReplyHeaderNames()
Returns the list of standard REQUEST headers.
|
protected java.util.List<java.lang.String> |
getStandardRequestHeaderNames()
Returns the PREFIX used by standard headers (if any)
|
protected void |
populateStandardHeaders(java.util.Map<java.lang.String,java.lang.Object> headers,
org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties
of an AMQP Message.
|
protected void |
populateUserDefinedHeader(java.lang.String headerName,
java.lang.Object headerValue,
org.springframework.amqp.core.MessageProperties amqpMessageProperties) |
fromHeadersToReply, fromHeadersToRequest, getHeaderIfAvailable, setReplyHeaderNames, setRequestHeaderNames, setUserDefinedHeaderPrefix, toHeadersFromReply, toHeadersFromRequest
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
fromHeadersToReply, fromHeadersToRequest, toHeadersFromReply, toHeadersFromRequest
protected java.util.Map<java.lang.String,java.lang.Object> extractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
extractStandardHeaders
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected java.util.Map<java.lang.String,java.lang.Object> extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
extractUserDefinedHeaders
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected void populateStandardHeaders(java.util.Map<java.lang.String,java.lang.Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties)
populateStandardHeaders
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected void populateUserDefinedHeader(java.lang.String headerName, java.lang.Object headerValue, org.springframework.amqp.core.MessageProperties amqpMessageProperties)
populateUserDefinedHeader
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected java.util.List<java.lang.String> getStandardRequestHeaderNames()
AbstractHeaderMapper
getStandardRequestHeaderNames
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected java.util.List<java.lang.String> getStandardReplyHeaderNames()
AbstractHeaderMapper
getStandardReplyHeaderNames
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
protected java.lang.String getStandardHeaderPrefix()
AbstractHeaderMapper
getStandardHeaderPrefix
in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>