With the aim of getting consumer group to topic mapping, similar to that in Kafka CLI, I was trying to use the describe_config
api offered by AdminClient
./kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group testing-group
GROUP TOPIC PARTITION CURRENT-OFFSET
testing-group testing-topic-xx 0 5
testing-group testing-topic-xx 1 7
LOG-END-OFFSET LAG CONSUMER-ID
5 0 console-consumer-1289
9 2 console-consumer-3456
However, while doing that I get the below exception. I'm using this example as reference.Further, the describe_config
api works while describing a topic but generates below exception while describing consumer group?
KafkaError{code=INVALID_REQUEST,val=42,str="This most likely occurs because of a request being malformed by the client library or the message was sent to an incompatible broker. See the broker logs for more details."}
reference:
kadmin = AdminClient({'bootstrap.servers': 'localhost:9092, localhost:9093'})
groups = kadmin.list_groups(timeout=10)
res_list = []
res_list.append(ConfigResource(ConfigResource.Type.GROUP, "testing-group-new"))
group_cfg = kadmin.describe_configs(res_list)
Once I have the group_cfg
, printing it as done here raises the exception shared above.