I am writing a kafka consumer that should deserialize incoming messages from avro. I do have the schema for the messages and was wondering what is the best way to deserialize those in vanilla kafka.
I searched for a while, but all the examples that I see are for File deserialization like this http://avro.apache.org/docs/1.9.0/gettingstartedjava.html
and do not cover the kafka message portion.
I did use the avro maven plugin and converted my schema to the pojo class.
Any advise is appreciated!
Thank you
You need to reverse the process of the producer. If the producer used the schema registry serializer, then you will need the registry for the deserializer, regardless of having the schema on your own.
Without knowing that serializer logic, it'll be difficult to write a deserializer.
The short answer is that you would use a BinaryDecoder - just like Confluent does
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With