本文介绍了kafka-console-consumer定制解串器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用kafka-console-consumer命令行工具时,我想使用我的自定义value.deserializer.像这样:

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...

如何引用适当的jar文件,以便脚本能够识别它?

How can I reference the appropriate jar file so that the script will recognize it?

推荐答案

如上所述,为此已打开JIRA( https://issues.apache.org/jira/browse/KAFKA-2526 )和自定义解串器尚未使用.

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.

这篇关于kafka-console-consumer定制解串器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 02:56