-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
allow "brokers" parameter in client configuration to be function #589
Comments
Broker discovery is built into the Kafka protocol. We just need a connection to a single broker to be able to discover the rest. So the list of brokers that you specify when you create the client is only used for this initial discovery (we call them "seed brokers"). There is one scenario I could see is if all the brokers in the cluster are replaced while the consumer is connected, and you're not using a load balancer or DNS (hard-coding a set of IPs). The consumer wouldn't have any way to recover currently, as none of the configured IPs would be valid anymore. Just making In the mean time, I would really recommend either having a load balancer in front of your brokers (not to actually distribute load, since any connections afterwards will go directly to the broker) or to use DNS so that |
Regardless of using the seed broker to discover other kafka brokers, I'd still like this functionality for one reason:
Having this function would allow a centralized place to put all logic for fetching the list of brokers. It could be called during initialization, then after a connection is lost after a certain # of retries. This could also address #593. |
So instead of current:
Also allow passing callback
When the connection to kafka is down, every reconnect attemt would also run rediscover and maybe get fresh IPs.
Another question: Right now the broker IP's can't be changed after client has been initialized?
The text was updated successfully, but these errors were encountered: