Class DefaultAmqpHeaderMapper
java.lang.Object
org.springframework.integration.mapping.AbstractHeaderMapper<MessageProperties>
org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper
- All Implemented Interfaces:
- Aware,- BeanClassLoaderAware,- AmqpHeaderMapper,- RequestReplyHeaderMapper<MessageProperties>
public class DefaultAmqpHeaderMapper
extends AbstractHeaderMapper<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
- Author:
- Mark Fisher, Oleg Zhurakousky, Gary Russell, Artem Bilan, Stephane Nicoll, Steve Singer
- 
Nested Class SummaryNested classes/interfaces inherited from class org.springframework.integration.mapping.AbstractHeaderMapperAbstractHeaderMapper.CompositeHeaderMatcher, AbstractHeaderMapper.ContentBasedHeaderMatcher, AbstractHeaderMapper.HeaderMatcher, AbstractHeaderMapper.PatternBasedHeaderMatcher, AbstractHeaderMapper.PrefixBasedMatcher, AbstractHeaderMapper.SinglePatternBasedHeaderMatcher
- 
Field SummaryFields inherited from class org.springframework.integration.mapping.AbstractHeaderMapperlogger, NON_STANDARD_HEADER_NAME_PATTERN, STANDARD_REPLY_HEADER_NAME_PATTERN, STANDARD_REQUEST_HEADER_NAME_PATTERN
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedDefaultAmqpHeaderMapper(String[] requestHeaderNames, String[] replyHeaderNames) 
- 
Method SummaryModifier and TypeMethodDescriptionextractStandardHeaders(MessageProperties amqpMessageProperties) Extract "standard" headers from an AMQP MessageProperties instance.extractUserDefinedHeaders(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, MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.protected voidpopulateStandardHeaders(Map<String, Object> headers, MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.protected voidpopulateUserDefinedHeader(String headerName, Object headerValue, MessageProperties amqpMessageProperties) Populate the specified user-defined headers to the specified source.Map from the given request object to abstractedMessageHeaders.Methods inherited from class org.springframework.integration.mapping.AbstractHeaderMappercreateDefaultHeaderMatcher, createHeaderMatcher, createTargetPropertyName, fromHeadersToReply, fromHeadersToRequest, getClassLoader, getHeaderIfAvailable, getTransientHeaderNames, setBeanClassLoader, setReplyHeaderNames, setRequestHeaderNames, toHeadersFromReplyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.mapping.RequestReplyHeaderMapperfromHeadersToReply, fromHeadersToRequest, toHeadersFromReply
- 
Constructor Details- 
DefaultAmqpHeaderMapper
 
- 
- 
Method Details- 
extractStandardHeadersExtract "standard" headers from an AMQP MessageProperties instance.- Specified by:
- extractStandardHeadersin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- amqpMessageProperties- the source object to extract standard headers.
- Returns:
- the map of headers to be mapped.
 
- 
extractUserDefinedHeadersExtract user-defined headers from an AMQP MessageProperties instance.- Specified by:
- extractUserDefinedHeadersin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- amqpMessageProperties- the source object to extract user defined headers.
- Returns:
- the map of headers to be mapped.
 
- 
populateStandardHeadersprotected void populateStandardHeaders(Map<String, Object> headers, MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.- Specified by:
- populateStandardHeadersin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- headers- the map of standard headers to be populated.
- amqpMessageProperties- the target object to populate headers.
 
- 
populateStandardHeadersprotected void populateStandardHeaders(@Nullable Map<String, Object> allHeaders, Map<String, Object> headers, MessageProperties amqpMessageProperties) Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.- Overrides:
- populateStandardHeadersin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- allHeaders- all headers including transient.
- headers- the map of standard headers to be populated.
- amqpMessageProperties- the target object to populate headers.
 
- 
populateUserDefinedHeaderprotected void populateUserDefinedHeader(String headerName, Object headerValue, MessageProperties amqpMessageProperties) Description copied from class:AbstractHeaderMapperPopulate the specified user-defined headers to the specified source.- Specified by:
- populateUserDefinedHeaderin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- headerName- the user defined header name to be populated.
- headerValue- the user defined header value to be populated.
- amqpMessageProperties- the target object to populate headers.
 
- 
toHeadersFromRequestDescription copied from interface:RequestReplyHeaderMapperMap from the given request object to abstractedMessageHeaders.- Specified by:
- toHeadersFromRequestin interface- RequestReplyHeaderMapper<MessageProperties>
- Overrides:
- toHeadersFromRequestin class- AbstractHeaderMapper<MessageProperties>
- Parameters:
- source- the native target request
- Returns:
- the abstracted MessageHeaders
 
- 
inboundMapperConstruct a default inbound header mapper.- Returns:
- the mapper.
- Since:
- 4.3
- See Also:
 
- 
outboundMapperConstruct 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
 
 
-