-
Notifications
You must be signed in to change notification settings - Fork 40.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring.json.type.mapping, kafka producer doesn't work with spring boot 3.3.0 #41240
Comments
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.
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. |
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. |
Yes please. There are too many unknowns at the moment with only a handful of properties to go on. |
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
in section above important mapping is:
spring.json.type.mapping
CustomKafkaJsonValueSerializer
is used to deliver customizedcom.fasterxml.jackson.databind.ObjectMapper
with sprig boot version 3.2.6 event on the kafka topic has inside the header key:
__TypeId__
with valuerawLogEvent
so it means that mapping works as expectedwith version 3.3.0 this key:
__TypeId__
cointains entrycom.charger.communication.service.event.RawLogEvent
, no mapping appliedI 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.
The text was updated successfully, but these errors were encountered: