1
0
mirror of https://github.com/taigrr/nats.docs synced 2025-01-18 04:03:23 -08:00
Stephen Asbury cc850776b8 Cleaned up developer doc
Proof'd everything and improved flow
Renamed advanced to events
Reordered sending/receiving
Added text type to languages for prism plugin
2019-05-16 13:06:37 -07:00

808 B

Receiving Messages

Receiving messages with NATS can be very library dependent.

Some languages, like Go or Java, provide synchronous and asynchronous APIs, while others may only support one type of subscription.

In all cases, the process of subscribing involves having the client library tell the NATS server that an application is interested in a particular subject.

Under the covers, the client library will assign a unique id to each subscription. This id is used when the server sends messages to a specific subscription. Each subscription gets a unique id, so if the same connection is used multiple times for the same subject, the server will send multiple copies of the same message. When an application is done with a subscription it unsubscribes which tells the server to stop sending messages.