dongwei7913 2018-06-06 06:49
浏览 415

如何使用confluent-kafka-go获取有关kafka经纪人错误的事件

I'm writing a producer in go, using the channel producer example of confluent-kafka-go library. When I run my app with brokers working then I get the produced events by reading from range producer.Events() .

But when the brokers are down, I get logs like the following from the kafka library printed in stderr, but I cannot find a way for my app to register for those errors so I can detect them:

%3|1528267290.204|FAIL|rdkafka#producer-1| [thrd:xxx.xxx.com:9092/bootstrap]: xxx.xxx.com:9092/bootstrap: Connect to ipv4#xxx.xxx.xxx.xxx:9092 failed: Connection refused
%3|1528267290.204|ERROR|rdkafka#producer-1| [thrd:xxx.xxx.com:9092/bootstrap]: 1/1 brokers are down

How can I receive those events from the library ? To clarify I'm interested in errors like RD_KAFKA_RESP_ERR__FAIL described in the docs

  • 写回答

1条回答 默认 最新

  • douyu3145 2018-08-28 08:14
    关注

    It seems there was no way to receive the errors, I have opened an issue and the fix will be released soon in v0.11.5:

    https://github.com/confluentinc/confluent-kafka-go/issues/200

    评论

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作