DevScript Saga

Welcome to DevScript Saga!

A little Helping Hand for Devs

A message queue is a durable component, stored in memory, that supports asynchronous communication. It serves as a buffer and distributes asynchronous requests.

Message queues make it possible for application to communicate asynchronously, by sending messages to each other vi a queue. Asynchronous processing allows a task to call a service and move on to the next task while service processes the request at it’s own pace.

The basic architecture of message queue is quite simple: there are client application called producers that create messages and deliver them to message queue. Another application called a consumer, connects to the queue and gets messages to be processed. Messages placed onto the queue are stored until consumer retrieves them.

Decoupling makes the message queue a preferred architecture for building a scalable and reliable application. With the message queue, the producer can post a message to the queue when the consumer is unavailable to process it. The consumer can read messages from the queue even when the producer is unavailable.

Examples of Message Queues include Kafka, Amazon SQS, RabbitMQ, Heron etc.

Role of Message Queues in Microservices architecture:

In Microservices architecture, there are cross-dependencies, which entail that no single service can perform its functionalities without getting help from other services.

This is where it’s crucial for your system to have a mechanism in place which allows services to keep in touch with each other without getting blocked by responses. Message queues fulfil this purpose by providing a means for services to push messages to a queue asynchronously and ensure that they get delivered to correct destination.

To implement a message queue between services, you need a message broker, who takes message from sender and delivers it correct destination.

Leave a comment