我是靠谱客的博主 激昂芹菜,这篇文章主要介绍kafka JsonParseException: Unrecognized token 'xxx': was expecting ('true', 'false' or 'null') 异常解决,现在分享给大家,希望可以做个参考。

ERROR WorkerSinkTask{id=local-file-sink-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:178)

 按照 http://kafka.apachecn.org/quickstart.html 中文文档做到 :

Step 7: 使用Kafka Connect来导入/导出数据

然后报了上面的异常

从kafka  JsonParseException: Unrecognized token 'xxx': was expecting ('true', 'false' or 'null') 可以知道是解析Json的时候异常

原因是我在:connect-file-sink.properties 里配置的 topic:liucf-topic3

之前在 Step 6: 设置多代理集群 中使用过connect-console-source.properties 通过控制台生产过消息,格式然后在topic:liucf-topic3中存在非json个的消息所以报上面的异常

 

解决办法是,清除这个topic里面的数据或者更换connect-file-sink.properties 里配置的topics=新的topic;

然后重新:bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties

connect-standalone.properties:

注意这之前要删除connect.offsets 不然新建的ConnectStandalone不能通过test.txt 生产消息到新的topic 因为它记录还是上一次创建ConnectStandalone对应的topic。

删除后重新:

bin/connect-standalone.sh config/connect-standalone.properties config/connect-file-source.properties config/connect-file-sink.properties

就可以了

 

 

最后

以上就是激昂芹菜最近收集整理的关于kafka JsonParseException: Unrecognized token 'xxx': was expecting ('true', 'false' or 'null') 异常解决的全部内容,更多相关kafka内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(60)

评论列表共有 0 条评论

立即
投稿
返回
顶部