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

Fix Typos

This PR fixes a number of typos and grammatical errors found within
the NATS documentation. Note that it is not comprehensive and there
are likely other errors to be found.
This commit is contained in:
Nick Calibey
2019-07-26 16:36:30 -05:00
parent 6ec19ef95f
commit 1fd055097b
15 changed files with 31 additions and 32 deletions

View File

@@ -1,13 +1,13 @@
# Buffering Messages During Reconnect Attempts
The NATS client libraries, try as much as possible to be fire and forget. One of the features that may be included in the library you are using is the ability to buffer outgoing messages when the connection is down.
The NATS client libraries try as much as possible to be fire and forget. One of the features that may be included in the library you are using is the ability to buffer outgoing messages when the connection is down.
During a short reconnect, these client can allow applications to publish messages that, because the server is offline, will be cached in the client. The library will then send those messages on reconnect. When the maximum reconnect buffer is reached, messages will no longer be publishable by the client.
Be aware, while the message appears to be sent to the application it is possible that it is never sent because the connection is never remade. Your applications should use patterns like acknowledgements to insure delivery.
Be aware, while the message appears to be sent to the application it is possible that it is never sent because the connection is never remade. Your applications should use patterns like acknowledgements to ensure delivery.
For clients that support this feature, you are able to configure the size of this buffer with bytes, messages or both.
!INCLUDE "../../_examples/reconnect_5mb.html"
> *As mentioned throughout this document, each client library may behave slightly differently. Please check the documentation for the library you are using.*
> *As mentioned throughout this document, each client library may behave slightly differently. Please check the documentation for the library you are using.*

View File

@@ -1,7 +1,7 @@
# Avoiding the Thundering Herd
When a server goes down, there is a possible anti-pattern called the *Thundering Herd* where all of the clients try to reconnect immediately creating a denial of service attack. In order to prevent this, most NATS client libraries randomize the servers they attempt to connect to. This setting has no effect if only a single server is used, but in the case of a cluster, randomization, or shuffling, will ensure that no one server bears the brunt of the client reconnect attempts.
When a server goes down, there is a possible anti-pattern called the *Thundering Herd* where all of the clients try to reconnect immediately, thus creating a denial of service attack. In order to prevent this, most NATS client libraries randomize the servers they attempt to connect to. This setting has no effect if only a single server is used, but in the case of a cluster, randomization, or shuffling, will ensure that no one server bears the brunt of the client reconnect attempts.
However, if you want to disable the randomization process, so that servers are always checked in the same order, you can do that in most libraries with a connection options:
!INCLUDE "../../_examples/reconnect_no_random.html"
!INCLUDE "../../_examples/reconnect_no_random.html"