微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

kafkacat一半时间返回主题内容

如何解决kafkacat一半时间返回主题内容

我两次运行kafkacat怎么可能没有从该主题返回任何信息?

bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
{"hello": "world"}
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
% Reached end of topic what-is-going-on2 [0] at offset 0
bash-3.2$
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c1
{"hello": "world"}

有人可以解释一下造成这种随机行为的原因吗?

我在其中添加了第二个元素,并且得到了相同的行为:

bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c2
{"hello": "world"}
{"hello": "world2"}
bash-3.2$ kafkacat -b localhost:9092 -t "what-is-going-on2" -C -c2
% Reached end of topic what-is-going-on2 [0] at offset 0

这是我的kafkacat版本:

kafkacat - Apache Kafka producer and consumer tool
https://github.com/edenhill/kafkacat
copyright (c) 2014-2019,Magnus Edenhill
Version 1.5.0 (JSON,Avro,librdkafka 1.4.2 builtin.features=gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。