kafka-go icon indicating copy to clipboard operation
kafka-go copied to clipboard

choose random broker to connect

Open JamesHello1990 opened this issue 3 years ago • 3 comments

Describe the solution you'd like A clear and concise description of what you want to happen.

image

here, the code will cause too many clients connect to the first broker ip

Supporting documentation

We can shuffle the brokers before choosing one

Please provides links to relevant Kafka protocol docs and/or KIPs.

JamesHello1990 avatar Jun 21 '21 09:06 JamesHello1990

You connect to leader, so i don't think that you need to shuffle ip. Or you mean that you connect to ip to get metadata about leader?

vtolstov avatar Jun 21 '21 12:06 vtolstov

The first broker in the list is only used once. If there's an error dialing the leader, the loop moves to the next broker.

Can you show Wireshark/tcpdump traffic that proves only the first is contacted "too many" times?

OneCricketeer avatar Oct 29 '21 15:10 OneCricketeer

@vtolstov Can you please provide a PR on how we might allow this?

derekbassett avatar Oct 29 '21 17:10 derekbassett