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&gt;&gt;
> describedGroups = describeConsumerGroups.describedGroups();
>                 Iterator<String&gt; iterator =
> describedGroups.keySet().iterator();
>                 while (iterator.hasNext()) {
>                         String key = iterator.next();
>                         KafkaFuture<ConsumerGroupDescription&gt; value =
> describedGroups.get(key);
>                         ConsumerGroupDescription consumerGroupDescription
> = value.get();
>                         Collection<MemberDescription&gt; members =
> consumerGroupDescription.members();
>                 }
>
>
>         }
>
>
>
> but i can't find about any method about bottom column:
> GROUP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TOPIC&nbsp; &nbsp; &nbsp;
> &nbsp; &nbsp; &nbsp;PARTITION&nbsp; CURRENT-OFFSET&nbsp;
> LOG-END-OFFSET&nbsp; LAG&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
> &nbsp;CONSUMER-ID&nbsp; &nbsp; &nbsp;HOST&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
> &nbsp; CLIENT-ID
>
>
>
> By its three info :
> PARTITION&nbsp; CURRENT-OFFSET&nbsp; LOG-END-OFFSET&nbsp;

Reply via email to