ERROR 向主题发送消息时出错

编程入门 行业动态 更新时间:2024-10-22 11:39:36
本文介绍了ERROR 向主题发送消息时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

在 kafka 中生成消息时,我收到以下错误:

While producing message in kafka, i am getting the following error :

$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic nil_PF1_P1
hi
hello

[2016-07-19 17:06:34,542] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 2 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafkamon.errors.TimeoutException: Failed to update metadata after 60000 ms.
[2016-07-19 17:07:34,544] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 5 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafkamon.errors.TimeoutException: Failed to update metadata after 60000 ms.


$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic nil_PF1_P1
Topic:nil_PF1_P1    PartitionCount:1    ReplicationFactor:1 Configs:
Topic: nil_PF1_P1   Partition: 0    Leader: 2   Replicas: 2 Isr: 2

对此有什么想法吗??

推荐答案

在代码本身中包含地址 0.0.0.0 而不是更改 server.properties.而不是

Instead of changing server.properties include the address 0.0.0.0 in the code itself. Instead of

/usr/bin/kafka-console-producer --broker-list Hostname:9092 --topic MyFirstTopic1

使用

/usr/bin/kafka-console-producer --broker-list 0.0.0.0:9092 --topic MyFirstTopic1

这篇关于ERROR 向主题发送消息时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-19 13:46:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/963085.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:发送消息   主题   ERROR

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!