最近更新的页面
Request-Reply Semantics
The pattern of sending a message and receiving a response is encapsulated in most client librarie...
Including a Reply Subject
The optional reply-to field when publishing a message can be used on the receiving side to respon...
Sending Messages
NATS sends and receives messages using a protocol that includes a target subject, an optional rep...
Draining Messages Before Disconnect
This feature is the ability to drain connections or subscriptions and then close the connection. ...
Queue Subscriptions
Subscribing to a queue group is only slightly different than subscribing to a subject alone. The ...
Wildcard Subscriptions
There is no special code to subscribe with a wildcard subject. Wildcards are a normal part of the...
Replying to a Message
Incoming messages have an optional reply-to field. If that field is set, it will contain a subjec...
Unsubscribing After N Messages
NATS provides a special form of unsubscribe that is configured with a message count and takes eff...
Unsubscribing
The client libraries provide a means to unsubscribe a previous subscription request. This process...
Asynchronous Subscriptions
Asynchronous subscriptions use callbacks of some form to notify an application when a message arr...
Slow Consumers
NATS is designed to move messages through the server quickly. As a result, NATS depends on the ap...
Listen for Connection Events
While the connection status is interesting, it is perhaps more interesting to know when the statu...
Monitoring the Connection
Managing the interaction with the server is primarily the job of the client library but most of t...
Pausing Between Reconnect Attempts
It doesn’t make much sense to try to connect to the same server over and over. To prevent this so...
Avoiding the Thundering Herd
When a server goes down, there is a possible anti-pattern called the Thundering Herd where all of...
Set the Number of Reconnect Attempts
Applications can set the maximum reconnect attempts per server. This includes the server provided...
Disabling Reconnect
You can disable automatic reconnect with connection options: Go // Disable reconnect attempts nc,...
Miscellaneous functionalities
This section contains miscellaneous functionalities and options for connect. Get the Maximum Payl...
Turning Off Echo'd Messages
By default a NATS connection will echo messages if the connection also has interest in the publis...
Ping/Pong Protocol
NATS client applications use a PING/PONG protocol to check that there is a working connection to ...