Apparently, in earlier kafka version, the list of consumers for a certain consumer group was stored in zookeeper. Where is this information stored for latest kafka release?
2 Answers
3
votes
Since Kafka 0.10, the list of Consumer Groups are stored in the __consumer_offsets
topic.
That topic contains both the committed offsets and the groups metadata (group.id, members, generation, leader, ...). Groups are stored using GroupMetadataMessage
messages (Offsets use OffsetsMessage
).
You can dump the groups metadata using the GroupMetadataMessageFormatter. For example:
./bin/kafka-console-consumer.sh \
--formatter "kafka.coordinator.group.GroupMetadataManager\$GroupMetadataMessageFormatter" \
--bootstrap-server localhost:9092 \
--topic __consumer_offsets
Note that this is a compacted topic, so to get the list of groups, you would need to "materialize" all entries. This is what brokers do when you use the listConsumerGroups()
API