What if pass downtime broker nodes to serviceUrl parameter when building PulsarClient #22933
AuroraTwinkle
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have opened an issue, please refer to the link:#22934
I am a beginner in Pulsar, and I found a problem. When I create a PulsarClient, if I pass a serviceUrl that contains multiple downtime broker nodes and a normal broker node, then creating a Consumer or Producer will most likely fail and throw an exception similar to the following:
By studying the source code, I found that when PulsarClient establishes a connection with the broker, it selects a node in the serviceUrl for connection in a round-robin order.
In my opinion, as long as there is a healthy broker node in serviceUrl, PulsarClient should be able to create Consumer or Producer normally. So I think there are some areas for improvement here. In the implementation of the
ServiceNameResolver
interface, we can perform periodic node detection and corresponding removal or recovery operations to avoid selecting unhealthy nodes when resolvingHost, thereby improving the robustness of the program. If you think this is an improvement, I will push a PR to solve this problem. Looking forward to your suggestions, thanks!Beta Was this translation helpful? Give feedback.
All reactions