nats-io / nats.rs

Rust client for NATS, the cloud native messaging system.
Apache License 2.0
980 stars 159 forks source link

expose retry_on_failed_connect option #1237

Closed cn-kali-team closed 1 month ago

cn-kali-team commented 3 months ago
paolobarbolini commented 3 months ago

It looks like retry_on_initial_connect is already doing what you're looking for and retry_on_failed_connect is just dead code

cn-kali-team commented 3 months ago

Oh, maybe this is the old code in syncing NATS. I can't reconnect in the consumer, but can I reconnect by switching to stream?

Jarema commented 3 months ago

The reconnect happens automatically in the client. You check the events on connection to see what's the state of connection. The retry_on_initial_connect is for the client to retry connecting if initial connection failed. Reconnecting afterwards will happen reagardless this option value.

Jarema commented 1 month ago

The dead code has been removed. Closing. Sorry for the confusion.