7

I recently set up a test Kafka cluster. I am running a consumer group listening on items and things seem to work. The name of consumer group is default. What surprises me is that listing consumer groups gives me an empty list:

$ ./bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --list
$

Also, explicitly querying the offsets doesn't yield anything:

$ ./bin/kafka-consumer-groups.sh --zookeeper localhost:2181 --describe --group default
No topic available for consumer group provided
GROUP, TOPIC, PARTITION, CURRENT OFFSET, LOG END OFFSET, LAG, OWNER

Do I need to manually create a consumer group using kafka-consumer-groups.sh —new-consumer to be able to track its offsets?

4

1 回答 1

16

好吧,我想通了。我正在使用新的消费者/生产者 API。这意味着我需要使用—new-consumer标志。例子:

$ ./bin/kafka-consumer-groups.sh --new-consumer --bootstrap-server localhost:9092 --list
default
$
于 2015-12-09T14:35:20.763 回答