1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00

Note about restarting server with mem store

Explain that in that case the client will report the connection as lost, even after a successful reconnect.
This commit is contained in:
Ivan Kozlovic 2020-07-27 16:38:03 -06:00 committed by GitHub
parent 551ce05853
commit 9db8514078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,3 +6,4 @@ This client ID links a given connection to its published messages, subscriptions
It is also used to resolve the issue of not having direct client connections to the server. For instance, say that a client crashes without closing the connection. It later restarts with the same client ID. The server will detect that this client ID is already in-use. It will try to contact that known client to its original private inbox. If the server does not receive a response - which would be the case if the client crashed - it will replace the old client with this new one. Otherwise, the server would reject the connection request since the client ID is already in-use.
**Note**: By default, the NATS Streaming Server stores its state in memory, which means that if the streaming server is stopped, all state is lost. On server restart, since no connection information is recovered, running applications will stop receiving messages and new published messages will be rejected with an `invalid publish request` error. Client libraries that support and set the `Connection Lost` handler \(refer to [this](https://github.com/nats-io/stan.go#connection-status) for more information\) will be notified that the connection is lost with the error `client has been replaced or is no longer registered`.