Kafka consumer list

前端 未结 8 1829
日久生厌
日久生厌 2020-12-12 19:38

I need to find out a way to ask Kafka for a list of topics. I know I can do that using the kafka-topics.sh script included in the bin\\ directory.

8条回答
  •  旧时难觅i
    2020-12-12 19:57

    You can also use kafkactl for this:

    # get all consumer groups (output as yaml)
    kafkactl get consumer-groups -o yaml
    
    # get only consumer groups assigned to a single topic (output as table)
    kafkactl get consumer-groups --topic topic-a
    

    Sample output (e.g. as yaml):

    name: my-group
    protocoltype: consumer
    topics:
     - topic-a
     - topic-b
     - topic-c
    

    Disclaimer: I am contributor to this project

提交回复
热议问题