Guillaume Bort created KAFKA-10422:
--------------------------------------

             Summary: Provide a `timesForOffsets` operation in kafka consumer
                 Key: KAFKA-10422
                 URL: https://issues.apache.org/jira/browse/KAFKA-10422
             Project: Kafka
          Issue Type: Improvement
          Components: clients, core
            Reporter: Guillaume Bort


The kafka consumer already provides an operation to quickly lookup the offsets 
by timestamp by using the `offsetsForTimes` operation.

However there are use cases where the inverse operation would be useful: having 
a set of offsets, I would like to lookup the ingestion timestamps for all these 
messages. Currently it would require fetching all these message by random 
access to retrieve the timestamps.

I propose to add the `timesForOffsets` operation to the kafka consumer. The 
operation signature would be equivalent to `offsetsForTimes`: given a mapping 
from partition to the offset to look up, it would return a mapping from 
partition to the timestamp and offset of the message at the requested offset. 
{{null}} would be returned for the partition if there is no message at this 
offset.

I think it would require an API change in `ListOffset`, so maybe it does 
require a KIP?

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to