Class AbstractPulsarHeaderMapper<ToPulsarHeadersContextType,ToSpringHeadersContextType>

java.lang.Object
org.springframework.pulsar.support.header.AbstractPulsarHeaderMapper<ToPulsarHeadersContextType,ToSpringHeadersContextType>
Type Parameters:
ToPulsarHeadersContextType - type of context object used in the toPulsarHeaders(org.springframework.messaging.MessageHeaders) API
ToSpringHeadersContextType - type of context object used in the toSpringHeaders(org.apache.pulsar.client.api.Message<?>) API
All Implemented Interfaces:
PulsarHeaderMapper
Direct Known Subclasses:
JsonPulsarHeaderMapper, ToStringPulsarHeaderMapper

public abstract class AbstractPulsarHeaderMapper<ToPulsarHeadersContextType,ToSpringHeadersContextType> extends Object implements PulsarHeaderMapper
Base PulsarHeaderMapper implementation that constrains which headers are mapped via header matchers.

Concrete implementations only need to specify how to convert a header value to and from Spring Messaging and Pulsar, by implementing the abstract toPulsarHeaderValue(java.lang.String, java.lang.Object, ToPulsarHeadersContextType) and toSpringHeaderValue(java.lang.String, java.lang.String, ToSpringHeadersContextType) methods.

Author:
Chris Bono
  • Field Details

  • Constructor Details

    • AbstractPulsarHeaderMapper

      public AbstractPulsarHeaderMapper(List<String> inboundPatterns, List<String> outboundPatterns)
      Construct a mapper that will match the supplied inbound and outbound patterns.

      NOTE: Internal framework headers are never mapped outbound. By default, the "id" and "timestamp" headers are also excluded from outbound mapping but can be included by adding them to outboundPatterns.

      NOTE: The patterns are applied in order, stopping on the first match (positive or negative). When no pattern is specified, the "*" pattern is added last. However, once a pattern is specified, the "*" is not added and must be added to the specified patterns if desired.

      Parameters:
      inboundPatterns - the inbound patterns to match - or empty to match all
      outboundPatterns - the outbound patterns to match - or empty to match all (except internal framework headers and id/timestamp)
      See Also:
  • Method Details