Yep, looking at the source code of our app we use to track lag, we're using that method.
On Wed, Apr 22, 2020 at 7:35 PM Liam Clarke-Hutchinson < liam.cla...@adscale.co.nz> wrote: > Looking at the source code, try listConsumerGroupOffsets(String > groupId, ListConsumerGroupOffsetsOptions options) instead? > > On Wed, Apr 22, 2020 at 6:40 PM 一直以来 <279377...@qq.com> wrote: > >> ./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 > >