diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-11-17 02:53:08 -0800 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-11-18 15:29:16 -0800 |
commit | cc8e91426907f8ccadd60eedc4dc53b8729a84ec (patch) | |
tree | ddbe457be9b8fc8cce68e0675ab6035c6b59b7d9 /kafka/structs.py | |
parent | 50690884e74d1cf1075d96bca0c028bc4d8e1e60 (diff) | |
download | kafka-python-cc8e91426907f8ccadd60eedc4dc53b8729a84ec.tar.gz |
Add list_consumer_group_offsets()
Support fetching the offsets of a consumer group.
Note: As far as I can tell (the Java code is a little inscrutable), the
Java AdminClient doesn't allow specifying the `coordinator_id` or the
`partitions`.
But I decided to include them because they provide a lot of additional
flexibility:
1. allowing users to specify the partitions allows this method to be used even for
older brokers that don't support the OffsetFetchRequest_v2
2. allowing users to specify the coordinator ID gives them a way to
bypass a network round trip. This method will frequently be used for
monitoring, and if you've got 1,000 consumer groups that are being
monitored once a minute, that's ~1.5M requests a day that are
unnecessarily duplicated as the coordinator doesn't change unless
there's an error.
Diffstat (limited to 'kafka/structs.py')
-rw-r--r-- | kafka/structs.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kafka/structs.py b/kafka/structs.py index e15e92e..baacbcd 100644 --- a/kafka/structs.py +++ b/kafka/structs.py @@ -72,6 +72,7 @@ PartitionMetadata = namedtuple("PartitionMetadata", ["topic", "partition", "leader", "replicas", "isr", "error"]) OffsetAndMetadata = namedtuple("OffsetAndMetadata", + # TODO add leaderEpoch: OffsetAndMetadata(offset, leaderEpoch, metadata) ["offset", "metadata"]) OffsetAndTimestamp = namedtuple("OffsetAndTimestamp", |