You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "wangjh@emrubik.com" <wa...@emrubik.com> on 2021/11/17 08:10:30 UTC

Hi Team,

Hi Team,

I  want obtain consumer group information through the Kafka JAVA API ,As shown in figure



        Properties properties = new Properties();
        properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "10.127.16.2:9092");

        try {
            String groupId = "gwdp-hdb-cq-t1";
            adminClient = AdminClient.create(properties);
            DescribeConsumerGroupsResult describeConsumerGroupsResult = adminClient.describeConsumerGroups(Arrays.asList(groupId));
            Map<String, KafkaFuture<ConsumerGroupDescription>> map = describeConsumerGroupsResult.describedGroups();

The ConsumerGroupDescription object does not get the information. how to get it ?many thanks in advance


Re: Hi Team,

Posted by "wangjh@emrubik.com" <wa...@emrubik.com>.
sorry ,  the picture is not displayed


 
From: wangjh@emrubik.com
Date: 2021-11-17 16:10
To: users
Subject: Hi Team,
Hi Team,

I  want obtain consumer group information through the Kafka JAVA API ,As shown in figure



        Properties properties = new Properties();
        properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "10.127.16.2:9092");

        try {
            String groupId = "gwdp-hdb-cq-t1";
            adminClient = AdminClient.create(properties);
            DescribeConsumerGroupsResult describeConsumerGroupsResult = adminClient.describeConsumerGroups(Arrays.asList(groupId));
            Map<String, KafkaFuture<ConsumerGroupDescription>> map = describeConsumerGroupsResult.describedGroups();

The ConsumerGroupDescription object does not get the information. how to get it ?many thanks in advance


Re: Hi Team,

Posted by Guozhang Wang <wa...@gmail.com>.
Hello,

Several things need to be checked here:

1) Is your group id correct? Does that exist and it's version is
sufficiently new that it does not store metadata on ZK but on Kafka?
2) Is the bootstrap server list correct? Is that IP reachable.



On Wed, Nov 17, 2021 at 12:24 AM wangjh@emrubik.com <wa...@emrubik.com>
wrote:

> sorry ,  the picture is not displayed
>
>
>
> *From:* wangjh@emrubik.com
> *Date:* 2021-11-17 16:10
> *To:* users <us...@kafka.apache.org>
> *Subject:* Hi Team,
> Hi Team,
>
> I  want obtain consumer group information through the Kafka JAVA API ,As
> shown in figure
>
>
>
>         Properties properties = new Properties();
>         properties.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, "10.127.16.2:9092");
>
>         try {
>             String groupId = "gwdp-hdb-cq-t1";
>             adminClient = AdminClient.create(properties);
>             DescribeConsumerGroupsResult describeConsumerGroupsResult = adminClient.describeConsumerGroups(Arrays.asList(groupId));
>             Map<String, KafkaFuture<ConsumerGroupDescription>> map = describeConsumerGroupsResult.describedGroups();
>
>
> The ConsumerGroupDescription object does not get the information. how to get it ?
>
> many thanks in advance
>
>
>

-- 
-- Guozhang