-
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
add support for on-demand topic metadata fetch #1541
add support for on-demand topic metadata fetch #1541
Conversation
I see the problem you're trying to solve and understand your approach here, but I'm not excited about the additional conceptual complexity here. I think the broker version probing issue could be avoided for now by setting an explicit |
This is a good question. AFAIK, sarama will not request any topic metadata before a real producer send operation. I like the lazy initialization.
This is not a doable way to resolve this problem. This just works around it. In case we operate many different Kafka version clusters, it is hard to let the users set api_version correctly themselves.
I agree with this approach. But it may take a long time, imo.
Yes. i also think it is not so grace. But it is implemented optionally and have no backward incompatibility. I think it can resolve the problem quickly and even later we support to no do any metadata prefetching, it should be alright and no backward incompatibility will be made. @dpkp WDYT? |
Ping @dpkp |
1 similar comment
Ping @dpkp |
ping @dpkp |
Sorry - Ive been quite busy. I hope to take another look over the weekend.
…On Thu, Jul 19, 2018, 9:19 PM Ning Xie ***@***.***> wrote:
ping @dpkp <https://github.com/dpkp>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1541 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAzetFpcx53z4Qv_DmOS8aVMTTnEe4IUks5uIVpDgaJpZM4VOaJh>
.
|
@dpkp Big thanks for your answer and waiting for your comments. :) |
Ping @dpkp |
1 similar comment
Ping @dpkp |
Sorry to periodically ping on this PR. @dpkp |
Ping @dpkp |
If we're going to land this I think we should name the config something more specific. Perhaps |
@dpkp Done. Please take a look at this. |
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.
Reviewed 1 of 3 files at r1, 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
@dpkp Big thanks! |
This PR adds support for on-demand topic metadata fetching. For now, a KafkaClient will fetch metadata for all topics in the initialization. This will have some performance problem when run with a large Kafka cluster.
Adding a
topics
(typeset
) key-value parameter toKafkaProducer
. This should be all the topics thatsend
will be invoked on. For example, ifsend
will be invoked onsend('a', ...)
andsend('b', ...)
, then the value fortopics
will be{'a', 'b'}
.This change is