Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for accessing cached offsets. #208

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Fischiii
Copy link

Added the possibility to access the local cached offsets of a consumer using rd_kafka_get_watermark_offsets as always fetching the offsets was to slow for our use case.

If there is already a way to access the currently cached offsets ignore this PR and please point me in the right direction.

@kenneth-jia
Copy link
Contributor

Hi, @Fischiii
Thank you for pointing it out!
Instead of creating new interfaces (e.g. beginningOffsetsCached/endOffsetsCached), maybe we could reuse the existed ones.
I'll refine the beginningOffsets(..., timeout)/endOffsets(..., timeout), to make them return cached offsets if timeout is 0.
(but please wait a few more days for the PR, -- due to my access limit)

@Fischiii
Copy link
Author

Fischiii commented Jul 5, 2023

@kenneth-jia I applied your suggested changes. I think it is a better solution than what I first proposed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants