-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update group.partitions_for_topic to fetch topic metadata if it does … #1781
Conversation
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.
This looks really close to me with just a few small tweaks...
If you can fixup / answer the questions, then I'd be happy to merge as its clearly affecting a bunch of people.
kafka/consumer/group.py
Outdated
|
||
Returns: | ||
set: topics | ||
def _fetch_all_topic_metadata(self): |
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.
Is the Java client structured this way with this private method?
It's a nice clean way to do it this way, but just curious how they handle it...
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.
Yep! I think that's what I based it on https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java#L1892
097a7c0
to
1878cc0
Compare
@jeffwidman Thanks for the feedback -- I addressed your comments, hopefully travis is kind to me. |
🎆 Thanks again for this! |
If the cluster metadata object has no info about the topic, then issue a blocking metadata call to fetch it.
…not have it
As mentioned in #1774, this attempts to simulate the Java client, which does the following
https://kafka.apache.org/10/javadoc/index.html?org/apache/kafka/clients/producer/KafkaProducer.html#partitionsFor
This change is