Interface PulsarHeaderMapper

All Known Implementing Classes:
AbstractPulsarHeaderMapper, JsonPulsarHeaderMapper, ToStringPulsarHeaderMapper

public interface PulsarHeaderMapper
Defines the contract for mapping Spring Messaging MessageHeaders to and from Pulsar message headers.

NOTE:Pulsar does not have the concept of message headers, but rather message metadata. The terms "Pulsar message headers" and "Pulsar message metadata" are used interchangeably.

Author:
Soby Chacko, Chris Bono
  • Method Summary

    Modifier and Type
    Method
    Description
    Map from the given Spring Messaging headers to Pulsar message headers.
    toSpringHeaders(org.apache.pulsar.client.api.Message<?> pulsarMessage)
    Map the headers from the given Pulsar message to Spring Messaging headers.
  • Method Details

    • toPulsarHeaders

      Map<String,String> toPulsarHeaders(MessageHeaders springHeaders)
      Map from the given Spring Messaging headers to Pulsar message headers.

      Commonly used in the outbound flow when a Spring message is being converted to a Pulsar message in order to be written out to Pulsar topic (outbound).

      Parameters:
      springHeaders - the Spring messaging headers
      Returns:
      map of Pulsar message headers or an empty map for no headers.
    • toSpringHeaders

      MessageHeaders toSpringHeaders(org.apache.pulsar.client.api.Message<?> pulsarMessage)
      Map the headers from the given Pulsar message to Spring Messaging headers.

      Commonly used in the inbound flow when an incoming Pulsar message is being converted to a Spring message.

      Parameters:
      pulsarMessage - the Pulsar message containing the headers to map
      Returns:
      the Spring Messaging headers