问题
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