Class PulsarHeaderObjectMapperUtils
java.lang.Object
org.springframework.pulsar.annotation.PulsarHeaderObjectMapperUtils
Resolves the
ObjectMapper
to use when serializing JSON header values.- Since:
- 1.2.0
- Author:
- Chris Bono
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<com.fasterxml.jackson.databind.ObjectMapper>
customMapper
(BeanFactory beanFactory) Gets the optionalObjectMapper
to use when deserializing JSON header values.
-
Method Details
-
customMapper
public static Optional<com.fasterxml.jackson.databind.ObjectMapper> customMapper(BeanFactory beanFactory) Gets the optionalObjectMapper
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
-