Using KafkaListener but facing issue to convert the content of the message #2533
alexandreab1202
started this conversation in
General
Replies: 1 comment 3 replies
-
I am not familiar with protobuf, but it looks like you are using a StringDeserializer - you either need a specific deserializer in your consumer configuration to decode the protobuff, or you need to receive it as a String or You should ask your question to a wider audience, familiar with using prototbuf with Kafka, perhaps on Stack Overflow. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Noob with Kafka here! Please tell me if this question is on the wrong place and I can delete it.
I've been using the

kafka-protobuf-console-producer
to publish a message to a topic with a proto file registered and the command like looks like it worked!My code works when I am using a simple java.lang.String but when I change to my specific Object (protocol buffer generated kotlin class) I get this issue.
But when my Kotlin with Spring Boot application using the
@KafkaListener()
try to consume the topic I get this message and I don't know what I am doing wrong:MessageConversionException: Cannot convert from [java.lang.String] to [com.MyProtoOrder$Items] for GenericMessage...
Could someone please, share Kotlin or Java examples using this listener to convert the message sent by the producer to a specific object or tell me what I am doing wrong in my application? Probably my mistake is in this Kotlin code with my object and the proto file that I am using when I produce the protocol buffer message?
fun consumeIngestion(myOrder: Order.Items) { ... }
Beta Was this translation helpful? Give feedback.
All reactions