public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> implements JmsHeaderMapper
JmsHeaderMapper
.
This implementation copies JMS API headers (e.g. JMSReplyTo) to and from
Messages
. Any user-defined
properties will also be copied from a JMS Message to a Message, and any
other headers on a Message (beyond the JMS API headers) will likewise
be copied to a JMS Message. Those other headers will be copied to the
general properties of a JMS Message whereas the JMS API headers are passed
to the appropriate setter methods (e.g. setJMSReplyTo).
Constants for the JMS API headers are defined in JmsHeaders
.
Note that most of the JMS headers are read-only: the JMSDestination,
JMSDeliveryMode, JMSExpiration, JMSMessageID, JMSPriority, JMSRedelivered
and JMSTimestamp flags are only copied from a JMS Message. Those
values will not be passed along from a Message to an outbound
JMS Message.
logger
CONTENT_TYPE_PROPERTY
Constructor and Description |
---|
SimpleJmsHeaderMapper() |
Modifier and Type | Method and Description |
---|---|
protected String |
fromHeaderName(String headerName)
Add the outbound prefix if necessary.
|
void |
fromHeaders(MessageHeaders headers,
Message jmsMessage)
Map from the given
MessageHeaders to the specified target message. |
protected String |
toHeaderName(String propertyName)
Add the inbound prefix if necessary.
|
MessageHeaders |
toHeaders(Message jmsMessage)
Map from the given target message to abstracted
MessageHeaders . |
getHeaderIfAvailable, setInboundPrefix, setOutboundPrefix
public void fromHeaders(MessageHeaders headers, Message jmsMessage)
HeaderMapper
MessageHeaders
to the specified target message.fromHeaders
in interface HeaderMapper<Message>
headers
- the abstracted MessageHeadersjmsMessage
- the native target messagepublic MessageHeaders toHeaders(Message jmsMessage)
HeaderMapper
MessageHeaders
.toHeaders
in interface HeaderMapper<Message>
jmsMessage
- the native target messageprotected String fromHeaderName(String headerName)
Convert MessageHeaders.CONTENT_TYPE
to content_type for JMS compliance.
fromHeaderName
in class AbstractHeaderMapper<Message>
AbstractHeaderMapper.setOutboundPrefix(java.lang.String)
protected String toHeaderName(String propertyName)
Convert content_type to MessageHeaders.CONTENT_TYPE
.
toHeaderName
in class AbstractHeaderMapper<Message>
AbstractHeaderMapper.setInboundPrefix(String)