Class DefaultJmsHeaderMapper
- All Implemented Interfaces:
HeaderMapper<Message>
JmsHeaderMapper.
This implementation copies JMS API headers (e.g. JMSReplyTo) to and from
Spring Integration Messages. JMS properties are mapped inbound only if their
names match the configured propertyNames patterns. All eligible Spring
Integration message headers are copied outbound to JMS general properties,
while JMS API headers are passed to the appropriate setter methods
(e.g. setJMSReplyTo).
Use DefaultJmsHeaderMapper(String...) to set the inbound
allowlist. Values support simple wildcard patterns (e.g. "myPrefix*",
"*mySuffix") and negation (e.g. "!unwanted*").
Pass "*" to allow all user-defined JMS properties.
- Author:
- Mark Fisher, Gary Russell, Artem Bilan, Glenn Renfro
-
Field Summary
Fields inherited from class JmsHeaderMapper
CONTENT_TYPE_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for this mapper.DefaultJmsHeaderMapper(String... propertyNames) Construct aDefaultJmsHeaderMapperwith the specified inbound property name patterns. -
Method Summary
Modifier and TypeMethodDescriptionvoidfromHeaders(MessageHeaders headers, Message jmsMessage) voidsetInboundPrefix(String inboundPrefix) Specify a prefix to be appended to the integration message header name for any JMS property that is being mapped into the MessageHeaders.voidsetMapInboundDeliveryMode(boolean mapInboundDeliveryMode) Map the inbounddeliveryModeby using this setter with 'true'.voidsetMapInboundExpiration(boolean mapInboundExpiration) Map the inboundexpirationby using this setter with 'true'.voidsetMapInboundPriority(boolean mapInboundPriority) Suppress the mapping of inbound priority by using this setter with 'false'.voidsetOutboundPrefix(String outboundPrefix) Specify a prefix to be appended to the JMS property name for any integration message header that is being mapped into the JMS Message.
-
Constructor Details
-
DefaultJmsHeaderMapper
public DefaultJmsHeaderMapper()Default constructor for this mapper.- Since:
- 5.5.22
-
DefaultJmsHeaderMapper
Construct aDefaultJmsHeaderMapperwith the specified inbound property name patterns. The default property entry name forpropertyNamesisMessageHeaders.CONTENT_TYPE.- Parameters:
propertyNames- the property name patterns to allow; supports*wildcards and!negation.- Since:
- 5.5.22
-
-
Method Details
-
setMapInboundPriority
public void setMapInboundPriority(boolean mapInboundPriority) Suppress the mapping of inbound priority by using this setter with 'false'.- Parameters:
mapInboundPriority- 'false' to suppress mapping the inbound priority.
-
setMapInboundDeliveryMode
public void setMapInboundDeliveryMode(boolean mapInboundDeliveryMode) Map the inbounddeliveryModeby using this setter with 'true'.- Parameters:
mapInboundDeliveryMode- 'true' to map the inbound delivery mode.- Since:
- 5.1
-
setMapInboundExpiration
public void setMapInboundExpiration(boolean mapInboundExpiration) Map the inboundexpirationby using this setter with 'true'.- Parameters:
mapInboundExpiration- 'true' to map the inbound expiration.- Since:
- 5.1
-
setInboundPrefix
Specify a prefix to be appended to the integration message header name for any JMS property that is being mapped into the MessageHeaders. The Default is an empty string (no prefix).This does not affect the JMS properties covered by the specification/API, such as JMSCorrelationID, etc. The header names used for mapping such properties are all defined in our
JmsHeaders.- Parameters:
inboundPrefix- The inbound prefix.
-
setOutboundPrefix
Specify a prefix to be appended to the JMS property name for any integration message header that is being mapped into the JMS Message. The Default is an empty string (no prefix).This does not affect the JMS properties covered by the specification/API, such as JMSCorrelationID, etc. The header names used for mapping such properties are all defined in our
JmsHeaders.- Parameters:
outboundPrefix- The outbound prefix.
-
fromHeaders
-
toHeaders
-