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

Add reconnect method #1085

Closed
scottf opened this issue Feb 27, 2024 · 3 comments
Closed

Add reconnect method #1085

scottf opened this issue Feb 27, 2024 · 3 comments
Labels
enhancement Enhancement to existing functionality

Comments

@scottf
Copy link
Contributor

scottf commented Feb 27, 2024

Overview

Client should have a way that allows users to force reconnection process.
This can be useful for refreshing auth or rebalancing clients.

When triggered, client will drop connection to the current server and perform standard reconnection process.
That means that all subscriptions and consumers should be resubscribed and their work resumed after successful reconnect where all reconnect options are respected.

For most clients, that means having a reconnect method on the Client/Connection handle.

Connection spec has been updated in #258

ADR Issue

nats-io/nats-architecture-and-design#259

@scottf scottf added proposal Enhancement idea or proposal enhancement Enhancement to existing functionality and removed proposal Enhancement idea or proposal labels Feb 27, 2024
@scottf
Copy link
Contributor Author

scottf commented Mar 26, 2024

#1100

@scottf scottf closed this as completed Mar 26, 2024
@pkgonan
Copy link

pkgonan commented Apr 4, 2024

@scottf
hello.

What if I change the JWT Credential and need to do a reconnect based on that token? I can't put the jwt credential in the reconnect API.

@scottf
Copy link
Contributor Author

scottf commented Apr 4, 2024

You could make a custom AuthHandler that reacts the way you want and is aware of changes. This might even be a good addition to the project, would you be interested in trying to contribute?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants