简体   繁体   中英

kafka-node: consumer group members/instances

Environment

  1. Node version: latest
  2. Kafka-node version: 2.6.1
  3. Kafka version: latest

Hi, there is a way to know or get Consumer Group members/consumers/instances? i know there is an option in Kafka itself ('GroupMembers') but i need it in node.

thanks

Kafka-node exposes an Admin API that has a describeGroups() method.

For example:

const client = new kafka.KafkaClient();
const admin = new kafka.Admin(client);
admin.describeGroups(['my-consumer-group'], (err, res) => {
    console.log(JSON.stringify(res, null, 1));
});

You can also use Kafka-node Admin API to list groups .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM