Class StreamJsonMapperAutoConfiguration

java.lang.Object
com.broadleafcommerce.common.messaging.autoconfigure.StreamJsonMapperAutoConfiguration

@Configuration @ConditionalOnClass(org.springframework.cloud.function.json.JsonMapper.class) @AutoConfigureBefore(org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration.class) public class StreamJsonMapperAutoConfiguration extends Object
Spring Boot 4.1 / Jackson migration support for spring-cloud-stream messaging.

spring-cloud-stream and spring-cloud-function perform message payload conversion through a spring-cloud-function JsonMapper that, by default, wraps a bare Jackson 3 (tools.jackson) ObjectMapper. That mapper has no awareness of Broadleaf money support (BroadleafMoneyModule + zalando jackson-datatype-money are Jackson 2 only), so CurrencyUnit/MonetaryAmount fields serialize as raw bean objects on the wire and cannot be read back by the money-aware Jackson 2 mapper used everywhere else in the platform. Broadleaf intentionally stays on Jackson 2, so the messaging path must as well.

Supplying a JsonMapper bean backed by the application's money-aware Jackson 2 ObjectMapper causes spring-cloud-function's @ConditionalOnMissingBean default to back off, so the existing stream JSON converter serializes/deserializes with Jackson 2 — without reordering converters or changing the serialized payload type. @AutoConfigureBefore ensures this bean is registered before the framework's default is considered.

  • Constructor Details

    • StreamJsonMapperAutoConfiguration

      public StreamJsonMapperAutoConfiguration()