public class DefaultAmqpHeaderMapper extends AbstractHeaderMapper<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 Map<String,Object> |
extractStandardHeaders(MessageProperties amqpMessageProperties)
Extract "standard" headers from an AMQP MessageProperties instance.
|
protected Map<String,Object> |
extractUserDefinedHeaders(MessageProperties amqpMessageProperties)
Extract user-defined headers from an AMQP MessageProperties instance.
|
protected String |
getStandardHeaderPrefix() |
protected List<String> |
getStandardReplyHeaderNames() |
protected List<String> |
getStandardRequestHeaderNames() |
protected void |
populateStandardHeaders(Map<String,Object> headers,
MessageProperties amqpMessageProperties)
Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties
of an AMQP Message.
|
protected void |
populateUserDefinedHeader(String headerName,
Object headerValue,
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 Map<String,Object> extractStandardHeaders(MessageProperties amqpMessageProperties)
extractStandardHeaders
in class AbstractHeaderMapper<MessageProperties>
protected Map<String,Object> extractUserDefinedHeaders(MessageProperties amqpMessageProperties)
extractUserDefinedHeaders
in class AbstractHeaderMapper<MessageProperties>
protected void populateStandardHeaders(Map<String,Object> headers, MessageProperties amqpMessageProperties)
populateStandardHeaders
in class AbstractHeaderMapper<MessageProperties>
protected void populateUserDefinedHeader(String headerName, Object headerValue, MessageProperties amqpMessageProperties)
populateUserDefinedHeader
in class AbstractHeaderMapper<MessageProperties>
protected List<String> getStandardRequestHeaderNames()
getStandardRequestHeaderNames
in class AbstractHeaderMapper<MessageProperties>
protected List<String> getStandardReplyHeaderNames()
getStandardReplyHeaderNames
in class AbstractHeaderMapper<MessageProperties>
protected String getStandardHeaderPrefix()
getStandardHeaderPrefix
in class AbstractHeaderMapper<MessageProperties>