How to get latest offset for a partition for a kafka topic?
Finally after spending a day on this and several false starts, I was able to find a solution and get it working. Posting it her so that others may refer to it. from kafka import SimpleClient from kafka.protocol.offset import OffsetRequest, OffsetResetStrategy from kafka.common import OffsetRequestPayload client = SimpleClient(brokers) partitions = client.topic_partitions[topic] offset_requests = [OffsetRequestPayload(topic, p, … Read more