Blizzard / Blizzard/node-rdkafka
offsetsForTimes(toppars, timeout, cb) function is returning the first offset instead of the offset within the given timestamp
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 403
- PR merge metrics
- No merged PRs in 30d
Description
I am currently trying to get offset for specified time. I found offsetsForTimes(toppars, timeout, cb) within the [documentation](https://blizzard.github.io/node-rdkafka/current/KafkaConsumer.html#offsetsForTimes). I tried putting the timestamp on the offset, for example.
```
offsetsForTimes([{topic: , partition: , offset: }], , )
```
But this returns the the very first offset instead of the first offset within the time range.
Contributor guide
Research direction
Start with the KafkaConsumer offsetsForTimes documentation and its implementation entry point, then verify how the timestamp is passed to Kafka and how the callback result is interpreted. Check timestamp units and expected Kafka/librdkafka behavior before adding a focused regression test; done means the requested topic-partition timestamp returns the corresponding offset rather than the earliest offset.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, kafka, nodejs
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100