From 9db8514078a652a899e9a33893da4e2128e439f9 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Mon, 27 Jul 2020 16:38:03 -0600 Subject: [PATCH 1/2] 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. --- nats-streaming-concepts/client-connections.md | 1 + 1 file changed, 1 insertion(+) diff --git a/nats-streaming-concepts/client-connections.md b/nats-streaming-concepts/client-connections.md index 5b7a092..781f55e 100644 --- a/nats-streaming-concepts/client-connections.md +++ b/nats-streaming-concepts/client-connections.md @@ -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`. From f91a00c6ed3ba3192c4cafe047c5d2cf0099dc08 Mon Sep 17 00:00:00 2001 From: Ginger Collison Date: Tue, 28 Jul 2020 09:56:35 -0500 Subject: [PATCH 2/2] Update client-connections.md --- nats-streaming-concepts/client-connections.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nats-streaming-concepts/client-connections.md b/nats-streaming-concepts/client-connections.md index 781f55e..09c1ab4 100644 --- a/nats-streaming-concepts/client-connections.md +++ b/nats-streaming-concepts/client-connections.md @@ -6,4 +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`. +**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 [connection status](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`.