NATS Chinese document: a request and response

Request - response is a modern distributed system in a common mode. A request is sent, the application waits for a response or a timeout has a specific, or asynchronous receive a response. Modern systems become more complex, it requires a clear position, scaling up and down, observability characteristics. Many techniques require additional components, sidecars mode and agents to complete the full set of features.

NATS its core communications mechanism to publish and subscribe to support this model. A request is issued to a given topic, and answer with a theme, the theme responder monitor response and sends the response to the theme. Reply theme is the only theme called Inbox, which is dynamically directed back to the requestor, regardless of the position of any party.

NATS allows multiple programs running and to form a dynamic response queues, to achieve a transparent extension. NATS application message before exiting emptied, which allows downsizing without discarding request. Since NATS is based publish-subscribe, it can be as simple observation of running another application, the application can request to view and to measure the response delay abnormality was observed, and the like directly scalability.

NATS ability even allows multiple responses, wherein the first response is utilized, the system effectively discard additional response. This allows a complex pattern with a plurality of responder reduce response delay and jitter.

By reading "request / reply" tutorial , using real-time server, try it yourself NATS request - reply.

Published 19 original articles · won praise 2 · Views 673

Guess you like

Origin blog.csdn.net/weixin_43465618/article/details/105113658