Class AbstractMessageAttributesHeaderMapper<A>

java.lang.Object
org.springframework.integration.aws.support.AbstractMessageAttributesHeaderMapper<A>
Type Parameters:
A - the target message attribute type.
All Implemented Interfaces:
org.springframework.integration.mapping.HeaderMapper<Map<String,A>>
Direct Known Subclasses:
SnsHeaderMapper, SqsHeaderMapper

public abstract class AbstractMessageAttributesHeaderMapper<A> extends Object implements org.springframework.integration.mapping.HeaderMapper<Map<String,A>>
Base HeaderMapper implementation for common logic in SQS and SNS around message attributes mapping.

The toHeaders(Map) is not supported.

Since:
2.0
Author:
Artem Bilan, Christopher Smith
  • Field Details

    • logger

      protected final org.apache.commons.logging.Log logger
  • Constructor Details

    • AbstractMessageAttributesHeaderMapper

      public AbstractMessageAttributesHeaderMapper()
  • Method Details

    • setOutboundHeaderNames

      public void setOutboundHeaderNames(String... outboundHeaderNames)
      Provide the header names that should be mapped to a AWS request object attributes (for outbound adapters) from a Spring Integration Message's headers. The values can also contain simple wildcard patterns (e.g. "foo*" or "*foo") to be matched. Also supports negated ('!') patterns. First match wins (positive or negative). To match the names starting with ! symbol, you have to escape it prepending with the \ symbol in the pattern definition. Defaults to map all (*) if the type is supported by SQS. The MessageHeaders.ID, MessageHeaders.TIMESTAMP, NativeMessageHeaderAccessor.NATIVE_HEADERS, AwsHeaders.MESSAGE_ID, AwsHeaders.QUEUE, and AwsHeaders.TOPIC are ignored by default.
      Parameters:
      outboundHeaderNames - The inbound header names.
    • fromHeaders

      public void fromHeaders(org.springframework.messaging.MessageHeaders headers, Map<String,A> target)
      Specified by:
      fromHeaders in interface org.springframework.integration.mapping.HeaderMapper<A>
    • buildMessageAttribute

      protected abstract A buildMessageAttribute(String dataType, Object value)
    • toHeaders

      public Map<String,Object> toHeaders(Map<String,A> source)
      Specified by:
      toHeaders in interface org.springframework.integration.mapping.HeaderMapper<A>