I would like to use my custom value.deserializer
when using the kafka-console-consumer command line tool. Something like this:
./kafka-console-consumer --bootstrap-server kafka2:29092 \
--property value.deserializer=My.Custom.KafkaDeserializer \
--topic TEST
But its unable to find my custom class...
Exception in thread "main" java.lang.ClassNotFoundException: My.Custom.KafkaDeserializer
How can I reference the appropriate jar file so that the script will recognize it?
Serialization is the process of converting objects into bytes. Deserialization is the inverse process — converting a stream of bytes into an object. In a nutshell, it transforms the content into readable and interpretable information.
How do I get the java application to appropriately deserialize a kafka message into a POJO? To reproduce the issue the following things have to be done: Run the command docker-compose up -d to bring up 3 instances of Zookeeper and Kafka. It also brings up Kafdrop that connects to the Kafka cluster.
You need to place the deserializer jar under the "libs" folder of your Kafka server.
As already said there is an opened JIRA for that (https://issues.apache.org/jira/browse/KAFKA-2526) and a custom deserializer can't be used yet.
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