I have problem after upgrade spring boot version from 3.2.6 to version 3.3.0

other dependency, they're the same even I change spring boot version: org.springframework.kafka:spring-kafka:3.2.0 com.fasterxml.jackson.module:jackson-module-kotlin:2.17.1 io.projectreactor.kafka:reactor-kafka:1.3.23

configuration for spring kafka

spring:
  kafka:
    bootstrap-servers:
      - localhost:9092
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: com.charger.communication.service.config.CustomKafkaJsonValueSerializer
      properties:
        spring.json.type.mapping: "rawLogEvent:com.charger.communication.service.event.RawLogEvent,
        detailedLogEvent:com.charger.communication.service.event.DetailedLogEvent,"
    properties:
      spring.json.trusted.packages: "*"

in section above important mapping is: spring.json.type.mapping

CustomKafkaJsonValueSerializer is used to deliver customized com.fasterxml.jackson.databind.ObjectMapper

with sprig boot version 3.2.6 event on the kafka topic has inside the header key: __TypeId__ with value rawLogEvent so it means that mapping works as expected

with version 3.3.0 this key: __TypeId__ cointains entry com.charger.communication.service.event.RawLogEvent, no mapping applied

I tried to check documentation for each module, nowhere info about changes. Also I try to obey suggested configuration without expected results.

I need your help to understand how to properly use mappings with newer spring boot version.

Comment From: wilkinsona

other dependency, they're the same even I change spring boot version

Upgrading from Spring Boot 3.2.x to Spring Boot 3.3.x should also upgrade Spring Kafka from 3.1.x to 3.2.x. Are you saying that you've overridden (or are not using) Spring Boot's dependency management? While it may not resolve this problem, you shouldn avoid downgrading a dependency to an older minor version as compatibility is not guaranteed.

spring.json.type.mapping

This is a Spring Kafka property. It's not clear to me from what you've described if Spring Boot is not passing it correctly into Spring Kafka or if Spring Kafka is not picking it up as it should.

If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.

Comment From: SzestKam

We don't use Spring Boot's dependency management in the project.

I put the question here because the issue is visible only when I change the Spring Boot version to higher. For some reason, Spring Kafka has been distributed with the newest version of the Spring Boot.

If it's necessary I'll try to prepare examples from my code.

Comment From: wilkinsona

If it's necessary I'll try to prepare examples from my code.

Yes please. There are too many unknowns at the moment with only a handful of properties to go on.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.