kafka-console-consumer custom deserializer

Viewed 6651

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?

2 Answers

You need to place the deserializer jar under the "libs" folder of your Kafka server.

Related