Spring Kafka Listener trying to convert String Payload to int #2205
-
If this is not an appropriate place for this, happy to delete it. I have this question posted on StackOverflow - https://stackoverflow.com/questions/71701721/spring-kafka-listener-trying-to-convert-string-payload-to-int Here is a simple Kafka consumer which takes a keyed message payload. To keep things simple, I have made the key and value both to be String. Similar code works on spring-kafka version 2.2.5.RELEASE. spring-kafka version: 2.5.13.RELEASE spring-boot version: 2.5.0 KafkaConfig.java
DebugRevenueMessageConsumer.java
application.yml:
Produced message: Kafka Listener tries to convert the payload to int -
Why is spring-kafka trying to convert the message to int? Looks like it is also stripping the message of all the spaces. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
It's generally not necessary to ask the same question in multiple places but, in this case, I didn't get a notification about the SO question because it was not tagged with I have absolutely no idea how this could happen; if you can provide a complete MCRE I can take a look. BTW, 2.5.x is no longer supported (OSS). https://spring.io/projects/spring-kafka#support |
Beta Was this translation helpful? Give feedback.
-
I had the same issue: Solution: P.S. Spring Boot v.2.7.6, spring-kafka dependency v.2.9.0 |
Beta Was this translation helpful? Give feedback.
It's generally not necessary to ask the same question in multiple places but, in this case, I didn't get a notification about the SO question because it was not tagged with
spring-kafka
.I have absolutely no idea how this could happen; if you can provide a complete MCRE I can take a look.
BTW, 2.5.x is no longer supported (OSS). https://spring.io/projects/spring-kafka#support