Message Broker

Posted By : Pankaj Garg | 31-Oct-2022

Message Broker

 

What is a message broker?

 

Message broker is software that helps to communicate between two or more applications and services with the help of messages. The message is initially defined by the service that sends them.

 

Working of a message broker.

There are three basic concepts involved in the working of this message broker.

 

1. Producer:- A producer is one who sends the message also known as the message publisher or message sender.

 

2. Consumer:- A consumer is the one who receives the message published or sent by the producer.

 

3. Queue:- Queue is also known as the Topic and it is the folder in the file system which stores the message in the form of a queue in the folder.

 

 

Types of message broker

 

1. Point-to-Point:-

In the point-to-point message broker, there is a one-to-one relationship between a sender and a receiver. The sender of the message does not know anything about the receiver and vice-versa.

 

2. Publisher/Subscriber:-

In the publish-subscriber message broker, there is one publisher and multiple receivers also known as subscribers. The message is sent by the publisher or producer and all the services that have subscribed to receive the message, initially, the message is saved to the queue and later on send to the subscribers.

 

Advantages of Publish-Subscribe

 

1. The publish-subscribe method provides communication between the services that may not be running at the same time because it saves the message in a queue.

 

2. It also improves the performance of the system by providing asynchronous processing.

 

3. The publish-subscribe also increases the reliability of the message by guaranteeing a transmission of a message.

 

Disadvantages of Publish-Subscribe

 

1. It increases the complexity

 

2. Harder to Debug

 

3. Steep learning curve at first

 

Uses

1. When two services are not running at the same time.

2. Where trust and reliability of the message sent are required.

About Author

Author Image
Pankaj Garg

Pankaj Garg is an experienced backend developer, specializing in Java and skilled in using technologies like MySQL, MongoDB, Spring Boot, Hibernate, and Spring Security. He has contributed to multiple internal and client projects. He has experience in creating POC projects such as Micro Services and Message Broker using Spring Security. He has also contributed to the development of the Book Store Management System, which utilizes Rest APIs to communicate from the database to the frontend, providing information on book availability. Along with his passion for coding, he also enjoys playing chess and badminton.

Request for Proposal

Name is required

Comment is required

Sending message..