Class JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder

java.lang.Object
org.springframework.pulsar.support.header.JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder
Enclosing class:
JsonPulsarHeaderMapper

public static class JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder extends Object
Author:
Chris Bono
  • Constructor Details

    • JsonPulsarHeaderMapperBuilder

      public JsonPulsarHeaderMapperBuilder()
  • Method Details

    • objectMapper

      public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder objectMapper(@Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Sets the object mapper to use to read/write header values as JSON.
      Parameters:
      objectMapper - the object mapper
      Returns:
      current builder
    • trustedPackages

      public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder trustedPackages(String... packages)
      Add packages to the trusted list used when deserializing JSON header values. Trust is by exact package match; a class is trusted only if its declaring package appears in this list. Sub-packages are not trusted transitively — add them explicitly if needed.

      The specified packages are added to JsonPulsarHeaderMapper.DEFAULT_TRUSTED_PACKAGES, which are always included. Pass "*" as the sole entry to trust all packages instead (not recommended when consuming from untrusted sources).

      If a class for a non-trusted package is encountered, the header is returned to the application with value of type JsonPulsarHeaderMapper.NonTrustedHeaderType.

      Parameters:
      packages - the packages to add to the trusted list - if any entry is "*" all packages are trusted and the defaults are ignored
      Returns:
      current builder
    • toStringClasses

      public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder toStringClasses(String... classNames)
      Add class names to the list of classes that should be serialized using their Object.toString() method.
      Parameters:
      classNames - the class names to add to the 'toString' list
      Returns:
      current builder
    • inboundPatterns

      public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder inboundPatterns(String... patterns)
      Adds to the list of patterns to be used for inbound header matching.
      Parameters:
      patterns - inbound patterns to add
      Returns:
      current builder
    • outboundPatterns

      public JsonPulsarHeaderMapper.JsonPulsarHeaderMapperBuilder outboundPatterns(String... patterns)
      Adds to the list of patterns to be used for outbound header matching.
      Parameters:
      patterns - outbound patterns to add
      Returns:
      current builder
    • build

      public JsonPulsarHeaderMapper build()