Class PulsarHeaderObjectMapperUtils

java.lang.Object
org.springframework.pulsar.annotation.PulsarHeaderObjectMapperUtils

public final class PulsarHeaderObjectMapperUtils extends Object
Resolves header mapper configuration beans (object mapper and trusted packages) for use during JSON header deserialization.
Since:
1.2.0
Author:
Chris Bono
  • Method Details

    • customMapper

      public static Optional<com.fasterxml.jackson.databind.ObjectMapper> customMapper(BeanFactory beanFactory)
      Gets the optional ObjectMapper to use when deserializing JSON header values. The mapper bean is expected to be registered with the name 'pulsarHeaderObjectMapper'.
      Parameters:
      beanFactory - the bean factory that may contain the mapper bean
      Returns:
      optional mapper or empty if bean not registered under the expected name
    • trustedPackages

      public static Optional<String[]> trustedPackages(BeanFactory beanFactory)
      Gets the optional trusted packages to use when deserializing JSON header values. The bean is expected to be a String[] registered with the name 'pulsarHeaderTrustedPackages'. Trust is by exact package match; sub-packages must be listed explicitly. Pass "*" as the sole entry to trust all packages.
      Parameters:
      beanFactory - the bean factory that may contain the trusted packages bean
      Returns:
      optional trusted packages or empty if bean not registered under the expected name