发生异常主题未找到错误代码 - Confluent

Exception Occurred Subject not found error code - Confluent

我可以在我的日志中看到一个错误,名称为 A.Abc-key 的主题不存在。 我列出了所有主题并验证 A.Abc-key 不存在但 A.Abc-value 存在

在检查相同主题的 属性-key 时,出现以下错误:

./kafka-avro-console-consumer --bootstrap-server http://localhost:9092 --from-beginning --属性 print.key =真--主题A.Abc

null    Processed a total of 1 messages
[2018-09-05 16:26:45,470] ERROR Unknown error when running consumer:  (kafka.tools.ConsoleConsumer$:76)
org.apache.kafka.common.errors.SerializationException: Error deserializing Avro message for id 80
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)

我不确定调试和修复这个问题。

您的错误与 HTTP 相关,因此请确保您的注册表在本地主机上 运行,因为您没有指定它

and verified that the A.Abc-key is not present

那么您的密钥不是 Avro,但如果您添加打印密钥,Avro 控制台消费者将尝试将您的密钥反序列化为 Avro 属性

您可以尝试添加 key-deserializer,如果您的注册表不在本地主机上,则必须指定它

--property schema.registry.url="http://..." \
--property key-deserializer=org.apache.kafka.common.serialization.StringDeserializer \
--property print.key=true