针对某个主题的消费者群体的紧凑展示

Compact display of consumer groups with respect to a certain topic

我试过了:

# kafka-consumer-groups.sh --bootstrap-server localhost:9092 --command-config client.properties --describe --all-groups --topic topic1

并得到:

选项“[topic]”不能与选项“[describe]”一起使用

所以我想出了一个简单的补丁:

# cat kafka-consumer-status.sh
#/bin/bash
if [[ -z  ]]; then
    echo "Missing parameter: topic"
    exit 1
fi
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --command-config client.properties --describe 
--all-groups 2>/dev/null |grep |awk '{print }'|uniq |xargs -n 1 kafka-consumer-groups.sh --bootstrap- 
server localhost:9092 --command-config client.properties --describe --group |grep -E "GROUP|"
#

这真的有必要吗,我是否忽略了 apache kafka CLI shell 命令已经可用的一些选项?

找到所有组,然后从这些组中获取主题是获取该信息的唯一方法。

标准用例是查找应用程序的延迟 (group.id)。查找从一个主题消费的所有应用程序(组)的滞后对用户几乎没有好处,这更多是一种管理功能,因此更适合使用 Burrow 或其他可以聚合此类指标的滞后收集实用程序

如果用例是查找从该主题使用的所有客户端地址,那么我所知道的 Cloudera SMM 工具之外没有好的数据沿袭产品