Example of a retry mechanism for connecting and subscribing #193
Unanswered
h0jeZvgoxFepBQ2C
asked this question in
Q&A
Replies: 1 comment
-
waitOnFirstConnect will continue to retry regardless of the maxReconnects setting. In your case I think you are looking for waitOnFirstConnect and maxReconnects to be -1. The client won't be able to subscribe or do anything until a connection is established. After a connect, if you disconnect, the client will attempt to reconnect forever, when it does, it will re-establish the subscriptions etc. Note that when the client disconnects, any data that was outbound will be dropped. If you need to know if you published, etc, you'll need to use request reply - on disconnect, your requests will reject. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
we are currently trying to implement nats.ws which should cover following scenarios:
For this usecase we have following questions:
We also tried the
waitOnFirstConnect
but then our connection attempts didnt do anything at all.. As far as we understoodwaitOnFirstConnect
just retries to connect instead of throwing a timeout error f.e.?Would be great if you could help us out here!
Beta Was this translation helpful? Give feedback.
All reactions