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
Refresh brokers given list of seed brokers #1781
Conversation
8605256
to
9ea2f4f
Compare
…oker to fetch metadata
9ea2f4f
to
654bd01
Compare
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.
LGTM
// Existing broker connections are closed and the updated list of seed brokers | ||
// will be used for the next metadata fetch. | ||
RefreshBrokers(addrs []string) error | ||
|
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.
I'm not sure how Sarama folks are adding new features, but this looks like it's a breaking change if someone is implementing the interface 🤔
not sure why someone would do that, but the interface is public 🤷
we could add a trick that I saw in the golang code, to add a private method, so no apps could implement the interface
// A private method to prevent users implementing the
// interface and so future additions to it will not
// violate Go 1 compatibility.
private()
found the blog post: https://blog.golang.org/module-compatibility
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.
Good idea, i'll add a dummy private()
method to the interface in another PR
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.
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 wasn't a good idea at the end :/ the initial intention of private()
is if the user needs to use an interface but don't want other people to implement it, and this is not the case for this interface.
RefreshBrokers
takes a list of addresses to be used as seed brokers.Existing broker connections are closed and the updated list of seed brokers will be used for the next metadata fetch.
RefreshBrokers
can be used in the case of failovers when the Kafka cluster's DNS would have to be re-resolved