Class ToStringPulsarHeaderMapper

java.lang.Object
org.springframework.pulsar.support.header.AbstractPulsarHeaderMapper<Object,Object>
org.springframework.pulsar.support.header.ToStringPulsarHeaderMapper
All Implemented Interfaces:
PulsarHeaderMapper

public class ToStringPulsarHeaderMapper extends AbstractPulsarHeaderMapper<Object,Object>
A PulsarHeaderMapper that converts header values using simple 'toString'.
Author:
Chris Bono
  • Constructor Details

    • ToStringPulsarHeaderMapper

      public ToStringPulsarHeaderMapper()
      Construct a 'ToString' mapper that will match all inbound headers and all outbound headers (except internal framework headers and id/timestamp).
    • ToStringPulsarHeaderMapper

      public ToStringPulsarHeaderMapper(List<String> inboundPatterns, List<String> outboundPatterns)
      Construct a 'ToString' mapper that will match the supplied inbound and outbound patterns.
      Parameters:
      inboundPatterns - the inbound patterns to match - or empty map to match all
      outboundPatterns - the outbound patterns to match - or empty to match all (except internal framework headers and id/timestamp)
  • Method Details

    • toPulsarHeaderValue

      protected @Nullable String toPulsarHeaderValue(String name, @Nullable Object value, @Nullable Object context)
      Description copied from class: AbstractPulsarHeaderMapper
      Determine the Pulsar header value to use for a Spring Messaging header.
      Specified by:
      toPulsarHeaderValue in class AbstractPulsarHeaderMapper<Object,Object>
      Parameters:
      name - the Spring Messaging header name
      value - the Spring Messaging header value, possibly null
      context - the optional context used for the mapping invocation
      Returns:
      the Pulsar header value to use
    • toSpringHeaderValue

      protected Object toSpringHeaderValue(String headerName, String rawHeader, @Nullable Object context)
      Description copied from class: AbstractPulsarHeaderMapper
      Determine the Spring Messaging header value to use for a Pulsar header.
      Specified by:
      toSpringHeaderValue in class AbstractPulsarHeaderMapper<Object,Object>
      Parameters:
      headerName - the Pulsar header name
      rawHeader - the Pulsar header value
      context - the optional context used for the mapping invocation
      Returns:
      the Spring Messaging header value to use