confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Implement tail (relative) offset

Open jzvelc opened this issue 2 years ago • 2 comments

Description

In golang implementation OffsetTail is available which returns the logical offset relativeOffset from current end of partition. It would be great to have this also available in python.

https://github.com/confluentinc/confluent-kafka-go/blob/v2.2.0/kafka/offset.go#L120

jzvelc avatar Oct 17 '23 08:10 jzvelc

OFFSET_END?

https://docs.confluent.io/platform/current/clients/confluent-kafka-python/html/index.html#offset

OneCricketeer avatar Nov 20 '23 20:11 OneCricketeer

Hi, this is different. OFFSET_END will start consuming from the point on consumer is subscribed. OffsetTail allows you to specify relative ofset from the current end of partition. E.g. let us say we have last message committed at offset 30 and we set OffsetTail to 2. This will consume from offset 29 (last two messages).

jzvelc avatar Nov 20 '23 20:11 jzvelc