5

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
  • You have to add this class into the classpath. Besides, even you do so, console-consumer tool still cannot use it since it's a known bug. See issues.apache.org/jira/browse/KAFKA-2526 Commented Aug 9, 2017 at 3:33

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

Comments

3

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.

1 Comment

I have checked confluent-community-5.1.0-2.11. It honors --value-deserializer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.