Class SimpleJmsHeaderMapper
- All Implemented Interfaces:
JmsHeaderMapper
,HeaderMapper<Message>
JmsHeaderMapper
.
This implementation copies JMS API headers (for example, 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 (for example, 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.
- Since:
- 4.1
- Author:
- Mark Fisher, Gary Russell, Stephane Nicoll
-
Field Summary
Fields inherited from class org.springframework.messaging.support.AbstractHeaderMapper
logger
Fields inherited from interface org.springframework.jms.support.JmsHeaderMapper
CONTENT_TYPE_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
fromHeaderName
(String headerName) Add the outbound prefix if necessary.void
fromHeaders
(MessageHeaders headers, Message jmsMessage) Map from the givenMessageHeaders
to the specified target message.protected String
toHeaderName
(String propertyName) Add the inbound prefix if necessary.Map from the given target message to abstractedMessageHeaders
.Methods inherited from class org.springframework.messaging.support.AbstractHeaderMapper
getHeaderIfAvailable, setInboundPrefix, setOutboundPrefix
-
Constructor Details
-
SimpleJmsHeaderMapper
public SimpleJmsHeaderMapper()
-
-
Method Details
-
fromHeaders
Description copied from interface:HeaderMapper
Map from the givenMessageHeaders
to the specified target message.- Specified by:
fromHeaders
in interfaceHeaderMapper<Message>
- Parameters:
headers
- the abstracted MessageHeadersjmsMessage
- the native target message
-
toHeaders
Description copied from interface:HeaderMapper
Map from the given target message to abstractedMessageHeaders
.- Specified by:
toHeaders
in interfaceHeaderMapper<Message>
- Parameters:
jmsMessage
- the native target message- Returns:
- the abstracted MessageHeaders
-
fromHeaderName
Add the outbound prefix if necessary.Convert
MessageHeaders.CONTENT_TYPE
tocontent_type
for JMS compliance.- Overrides:
fromHeaderName
in classAbstractHeaderMapper<Message>
- See Also:
-
toHeaderName
Add the inbound prefix if necessary.Convert the JMS-compliant
content_type
toMessageHeaders.CONTENT_TYPE
.- Overrides:
toHeaderName
in classAbstractHeaderMapper<Message>
- See Also:
-