concept NATS in category microservice

This is an excerpt from Manning's book Microservices Security in Action.
In most cases, synchronous communications happen over HTTP. Asynchronous communications can happen over any kind of messaging system such as RabbitMQ, Apache Kafka, NATS, ActiveMQ, or even Amazon SQS. In this chapter, we discuss how to use Kafka and NATS as a message broker, which enables microservices to communicate with each other in an event-driven fashion, and how to secure the communication channels.
Kafka is the most popular messaging system used in many microservice deployments. If you’re interested in learning more about Kafka, we recommend Kafka in Action by Dylan Scott (Manning, 2020). NATS is an open source, lightweight, high-performing messaging system designed for cloud-native applications, which is also an alternative to Kafka. If you’re interested in learning more about NATS, we recommend Practical NATS by Waldemar Quevedo (Apress, 2018).
In this section, we take a look at NATS, an alternative message broker to Kafka, which can be used by event-driven microservices to exchange messages/events. NATS (https://nats.io/) is an open source, lightweight messaging system designed for cloud-native applications. It is a project of the CNCF.
Similar to Kafka, it too has a concept of publishers and subscribers. NATS publishers send messages to subjects, and subscribers connected to those subjects can receive the messages. A subject in NATS is just a string identifier that publishers and subscribers use to find each other. Figure 9.11 illustrates how subjects are used by NATS publishers and subscribers.
NATS offers an at-most-once quality of service for its messages: it will deliver messages only to subscribers connected to and listening on the respective subject. Unlike in Kafka, NATS core does not offer persistent message delivery. If the receiver is not connected to the NATS server at the time of message delivery, it will not receive the message after it reconnects. It is basically a fire-and-forget message delivery system. If the clients require higher levels of message delivery guarantees, you either need to build guarantees into the client applications themselves or use NATS streaming (https://docs.nats.io/nats-streaming-concepts/intro).
Received message: Welcome to NATS