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 #1201

Closed
Jarema opened this issue Jan 30, 2024 · 1 comment
Closed

Add reconnect method #1201

Jarema opened this issue Jan 30, 2024 · 1 comment
Labels
accepted The defect or proposal as been accepted help wanted

Comments

@Jarema
Copy link
Member

Jarema commented Jan 30, 2024

Proposed change

Implement reconnect method according to an connection ADR update nats-io/nats-architecture-and-design#259

From the ADR spec update:

On-Demand reconnect

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.

Use case

If for whatever reason client would like to reconnect, right now they have to recreate all Core nats subscriptons and Jetstream Consumers. This can be unnecessary complication, especially considering that client already can reconnect and recover all subscription and consumers processing. It just is missing API for triggering it on demand.

@Jarema Jarema added accepted The defect or proposal as been accepted help wanted labels Jan 30, 2024
@Jarema
Copy link
Member Author

Jarema commented May 20, 2024

implemented in #1240

@Jarema Jarema closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The defect or proposal as been accepted help wanted
Projects
None yet
Development

No branches or pull requests

1 participant