Skip to content

Best practices for retries and error handling #244

Answered by aricart
hypeJunction asked this question in Q&A
Discussion options

You must be logged in to vote

@hypeJunction really it depends on the context on how you view the connection.

For a service - you would want the connection to always retry to heal itself if there's a disconnect (network outages are expected) - this is how NATS connections in general work. On a web application possibly the same idea but only while a "session" is active.

Now - a closed connection means that the only way to connect again is to call the connect() function - Any API usage on a closed connection will fail with an error. Note the difference - a disconnected state simply means that there's no connection now, but the client is actively retrying as per its connect configuration.

When a client disconnects - the s…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@aricart
Comment options

@hypeJunction
Comment options

Answer selected by aricart
Comment options

You must be logged in to vote
2 replies
@aricart
Comment options

@aricart
Comment options

Comment options

You must be logged in to vote
1 reply
@aricart
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants