I have python script and I need to retrieve the current consumer group offset for a set of consumers reading from a kafka topic, using a kafka1 broker cluster. These are native kafka consumers that store the offset in the kafka cluster, not in zookeeper.
The script itself does not need to consume any messages, just read the current offset for other consumers. I realise it is possible to do this with kafka-consumer-groups.sh
but ideally I want to avoid relying on shell commands.
I can already do this utilising the dpkp/kafka-python
client, but only by creating a consumer and assigning it to the group, which then affects the existing consumers using that group by de-allocating some partitions. I need the script to be entirely passive, not performing any action that will interrupt the other consumers.