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

Add support for Tail(N)

Open bryopsida opened this issue 6 years ago • 2 comments

Description

First I would like to say thank for you developing this library and I apologize if this is not in the correct for a feature request/enhancement.

I have a need to set my offset to the End - 1, the use case for this is I need to get the most recent/last message on a topic for a topic that may not get another message for 10-15 minutes. Currently I achieve this by using QueryWaterMarks and then doing the necessary manual adjustments to the offset and seeking. It would be nice if the OffsetTail functionality of the librdkafa library was exposed to allow setting the offset to a set number behind the end of a topic.

bryopsida avatar Feb 19 '19 01:02 bryopsida

thanks for the suggestion @akboyd88. my feeling is we shouldn't add this (yet), since it's not really a primary use case of Kafka, and there is a way to do this with the existing API that isn't too bad. Note: I'd suggest using GetWatermarkOffsets if possible since that won't do a server request (whereas QueryWatermarkOffsets will. I say 'yet', since this would be a more important to support well if Kafka ever gets sub-partitions, which I think it probably will, and certainly hope it does.

mhowlett avatar Feb 19 '19 17:02 mhowlett

Is it valid to use -2001 special offset value in this library for End-1?

zahirtezcan-bugs avatar Mar 04 '24 17:03 zahirtezcan-bugs