Kafka - error when producing from command line (character ('<' (code 60)): expected a valid value)

喜欢而已 提交于 2019-12-07 07:25:38
Giorgos Myrianthous

kafka-avro-console-producer, by default, assumes that Schema Registry is listening at port http://localhost:8081. However, if another process is listening to that port, weird errors might occur.

In order to overcome this issue, you can specify the schema URL when running the producer using --property schema.registry.url=http://localhost:18081

For example,

kafka-avro-console-producer \
         --broker-list localhost:9092 --topic simple \
         --property value.schema='{"type":"record","name":"myrecord","fields":[{"name":"f1","type":"string"}]}' \
         --property schema.registry.url=http://localhost:18081
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!