Skip to content
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

Rework connection and reconnection #19

Open
dmccarthy-bluefin opened this issue Sep 7, 2022 · 0 comments
Open

Rework connection and reconnection #19

dmccarthy-bluefin opened this issue Sep 7, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dmccarthy-bluefin
Copy link
Contributor

Hi,

I would like to add new options to the connection and reconnection setup to make it work more like the node.js lib. On the node lib you can set the server connection param to a host:port string or array of host:port strings. If the array is used the client cycles through the array until it finds a server that it can connect to. There is also an parameter to shuffle the order of the host:port strings before attempting to connect. This should have the effect of load balancing connections.

While I'm at it I will look into connecting to an alternative server when the connected server goes into lame duck mode. https://docs.nats.io/running-a-nats-service/nats_admin/lame_duck_mode

I should be able to implement the above while leaving the current usage intact. I see that the node lib retained it's separate host and port params when it added the server param. I'm letting you know in case one of you is already working on this feature.

Regards

@nekufa nekufa added the enhancement New feature or request label Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants