-
Notifications
You must be signed in to change notification settings - Fork 915
Expose offsets_for_times consumer method. closes #224 #268
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
Expose offsets_for_times consumer method. closes #224 #268
Conversation
I have tested this on an actual kafka instance, but there doesn't appear to be integration tests. So i have only checked in the basic smoke test. |
fe3cd06
to
c2e2807
Compare
Expose offsets_for_times consumer method. closes confluentinc#224 Expose offsets_for_times consumer method. closes confluentinc#224 Expose offsets_for_times consumer method. closes confluentinc#224
c2e2807
to
c7ea58f
Compare
failing on untouched pep8 issues
|
Other then the flake8 fails. anything this needs? |
bump. happy to respond to any comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One doc fix needed.
Please also add a call to offsets_for_times() to the consumer integration test, just making sure it returns some valid offsets.
confluent_kafka/src/Consumer.c
Outdated
" corresponding partition.\n" | ||
"\n" | ||
" :param list(TopicPartition) partitions: topic+partitions with timestamps in the TopicPartition.offset field." | ||
" :param float timeout: Request timeout (when cached=False).\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cache mention
Thank you for this, almost there! |
After some more testing I think i have found an issue with calling |
Found some more issues. The first call from a newly created consumer will fail like so:
I suspect the same issue a #196 and underlying confluentinc/librdkafka#1373 Adding a timeout causes it to work. |
It could be that my code has an issue but I think there are issues with the underlying C implementation. Without a formal integration setup that spins up a fresh kafka, sharing a reproducible example is a pain but here is a simple script: This script shows two issues. First calling offset_for_times without a timeout or a -1 timeout, returns a copy of the TopicPartition objects you passed in. Second, calling
Outputs:
|
Running locally with these changes to librdkafka: confluentinc/librdkafka#1525 i get good results:
|
Is there proper documentation for this? |
Expose offsets_for_times consumer method. closes #224