./kafka-consumer-groups.sh --bootstrap-server localhost:9081 --describe --group
test
use describeConsumerGroups method ??
private static void print() throws InterruptedException,
ExecutionException {
Properties props = new Properties();
props.setProperty("bootstrap.servers",
"192.168.1.100:9081,192.168.1.100:9082,192.168.1.100:9083,,192.168.1.100:9087,,192.168.1.100:9088");
AdminClient client = KafkaAdminClient.create(props);
DescribeConsumerGroupsResult describeConsumerGroups =
client.describeConsumerGroups(Arrays.asList("test"));
Map<String, KafkaFuture<ConsumerGroupDescription>>
describedGroups = describeConsumerGroups.describedGroups();
Iterator<String> iterator =
describedGroups.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next();
KafkaFuture<ConsumerGroupDescription> value =
describedGroups.get(key);
ConsumerGroupDescription consumerGroupDescription =
value.get();
Collection<MemberDescription> members =
consumerGroupDescription.members();
}
}
but i can't find about any method about bottom column:
GROUP TOPIC
PARTITION CURRENT-OFFSET LOG-END-OFFSET
LAG CONSUMER-ID
HOST CLIENT-ID
By its three info :
PARTITION CURRENT-OFFSET LOG-END-OFFSET