skip to Main Content

I read the consumer group example in here(provided by Shopify/sarama),
and I wonder that how would I know how many consumers are in a consumer group, are there any ways I could control the number of consumers?

Thanks a lot

2

Answers


  1. To list the consumers currently assigned to a group, you can use the kafka-consumer-groups .sh shell script. Assuming that $KAFKA_HOME is the root directory of your Kafka installation, you can do:

    $KAFKA_HOME/bin/kafka-consumer-groups.sh --describe --group YOURGROUP --zookeeper ZOOKEEPER_HOST:PORT
    

    If you want to list current groups, run the following command:

    $KAFKA_HOME/bin/kafka-consumer-groups.sh --list --zookeeper ZOOKEEPER_HOST:PORT
    
    Login or Signup to reply.
  2. You can use ClusterAdmin interface in Sarama library.

    https://pkg.go.dev/github.com/Shopify/sarama#ClusterAdmin

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search