kafka-console-consumer custom deserializer

99封情书 提交于 2020-01-03 17:01:33

问题


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?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/45581082/kafka-console-consumer-custom-deserializer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!