Class DefaultAmqpHeaderMapper
java.lang.Object
org.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,AmqpHeaderMapper,org.springframework.integration.mapping.RequestReplyHeaderMapper<org.springframework.amqp.core.MessageProperties>
public class DefaultAmqpHeaderMapper
extends org.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
implements AmqpHeaderMapper
Default implementation of
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.
- Since:
- 2.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.integration.mapping.AbstractHeaderMapper
org.springframework.integration.mapping.AbstractHeaderMapper.CompositeHeaderMatcher, org.springframework.integration.mapping.AbstractHeaderMapper.ContentBasedHeaderMatcher, org.springframework.integration.mapping.AbstractHeaderMapper.HeaderMatcher, org.springframework.integration.mapping.AbstractHeaderMapper.PatternBasedHeaderMatcher, org.springframework.integration.mapping.AbstractHeaderMapper.PrefixBasedMatcher, org.springframework.integration.mapping.AbstractHeaderMapper.SinglePatternBasedHeaderMatcher -
Field Summary
Fields inherited from class org.springframework.integration.mapping.AbstractHeaderMapper
logger, NON_STANDARD_HEADER_NAME_PATTERN, STANDARD_REPLY_HEADER_NAME_PATTERN, STANDARD_REQUEST_HEADER_NAME_PATTERN -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultAmqpHeaderMapper(String[] requestHeaderNames, String[] replyHeaderNames) -
Method Summary
Modifier and TypeMethodDescriptionextractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties) Extract "standard" headers from an AMQP MessageProperties instance.extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties) Extract user-defined headers from an AMQP MessageProperties instance.static DefaultAmqpHeaderMapperConstruct a default inbound header mapper.static String[]static String[]static DefaultAmqpHeaderMapperConstruct a default outbound header mapper.static String[]static String[]protected voidpopulateStandardHeaders(Map<String, Object> allHeaders, Map<String, Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.protected voidpopulateStandardHeaders(Map<String, Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.protected voidpopulateUserDefinedHeader(String headerName, Object headerValue, org.springframework.amqp.core.MessageProperties amqpMessageProperties) toHeadersFromRequest(org.springframework.amqp.core.MessageProperties source) Methods inherited from class org.springframework.integration.mapping.AbstractHeaderMapper
createDefaultHeaderMatcher, createHeaderMatcher, createTargetPropertyName, fromHeadersToReply, fromHeadersToRequest, getClassLoader, getHeaderIfAvailable, getTransientHeaderNames, setBeanClassLoader, setReplyHeaderNames, setRequestHeaderNames, toHeadersFromReplyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.mapping.RequestReplyHeaderMapper
fromHeadersToReply, fromHeadersToRequest, toHeadersFromReply
-
Constructor Details
-
DefaultAmqpHeaderMapper
-
-
Method Details
-
extractStandardHeaders
protected Map<String,Object> extractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties) Extract "standard" headers from an AMQP MessageProperties instance.- Specified by:
extractStandardHeadersin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
extractUserDefinedHeaders
protected Map<String,Object> extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties) Extract user-defined headers from an AMQP MessageProperties instance.- Specified by:
extractUserDefinedHeadersin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
populateStandardHeaders
protected void populateStandardHeaders(Map<String, Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.- Specified by:
populateStandardHeadersin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
populateStandardHeaders
protected void populateStandardHeaders(@Nullable Map<String, Object> allHeaders, Map<String, Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.- Overrides:
populateStandardHeadersin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
populateUserDefinedHeader
protected void populateUserDefinedHeader(String headerName, Object headerValue, org.springframework.amqp.core.MessageProperties amqpMessageProperties) - Specified by:
populateUserDefinedHeaderin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
toHeadersFromRequest
public Map<String,Object> toHeadersFromRequest(org.springframework.amqp.core.MessageProperties source) - Specified by:
toHeadersFromRequestin interfaceorg.springframework.integration.mapping.RequestReplyHeaderMapper<org.springframework.amqp.core.MessageProperties>- Overrides:
toHeadersFromRequestin classorg.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
-
inboundMapper
Construct a default inbound header mapper.- Returns:
- the mapper.
- Since:
- 4.3
- See Also:
-
outboundMapper
Construct a default outbound header mapper.- Returns:
- the mapper.
- Since:
- 4.3
- See Also:
-
inboundRequestHeaders
- Returns:
- the default request headers for an inbound mapper.
- Since:
- 4.3
-
inboundReplyHeaders
- Returns:
- the default reply headers for an inbound mapper.
- Since:
- 4.3
-
outboundRequestHeaders
- Returns:
- the default request headers for an outbound mapper.
- Since:
- 4.3
-
outboundReplyHeaders
- Returns:
- the default reply headers for an outbound mapper.
- Since:
- 4.3
-