问题描述
我正在为 Kafka 0.9.0.0 做 Kafka 快速入门.
I am doing the Kafka Quickstart for Kafka 0.9.0.0.
我让zookeeper在localhost:2181
监听,因为我跑了
I have zookeeper listening at localhost:2181
because I ran
bin/zookeeper-server-start.sh config/zookeeper.properties
我有一个代理监听 localhost:9092
因为我跑了
I have a single broker listening at localhost:9092
because I ran
bin/kafka-server-start.sh config/server.properties
我有一个制作人发布主题测试",因为我跑了
I have a producer posting to topic "test" because I ran
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
yello
is this thing on?
let's try another
gimme more
当我运行旧的 API 使用者时,它运行
When I run the old API consumer, it works by running
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
然而,当我运行新的 API 消费者时,我运行时什么也没有
However, when I run the new API consumer, I don't get anything when I run
bin/kafka-console-consumer.sh --new-consumer --topic test --from-beginning \
--bootstrap-server localhost:9092
是否可以使用新的 api 从控制台使用者订阅主题?我该如何解决?
Is it possible to subscribe to a topic from the console consumer using the new api? How can I fix it?
推荐答案
我的 MAC 盒子遇到了同样的问题,即控制台消费者在使用命令时不消耗任何消息
I my MAC box I was facing the same issue of console-consumer not consuming any messages when used the command
kafka-console-consumer --bootstrap-server localhost:9095 --from-beginning --topic my-replicated-topic
但是当我尝试使用
kafka-console-consumer --bootstrap-server localhost:9095 --from-beginning --topic my-replicated-topic --partition 0
它愉快地列出了发送的消息.这是 Kafka 1.10.11 中的错误吗?
It happily lists the messages sent. Is this a bug in Kafka 1.10.11?
这篇关于消费者未收到消息,kafka 控制台,新的消费者 api,Kafka 0.9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!