Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Follow publication

What is the difference Message Queue and Message Bus?

Emir Ayhan
Stackademic
Published in
2 min readMar 16, 2022

--

Message Queue

It is one of the common questions I often come across while I am chatting with my friend or searching for something on the Internet. I will try to explain these two confusing terms to you in this article.

The definition of a message queue is to receive a bunch of messages from one application and to deliver them to one or more other applications on a first-in-first-out (FIFO) basis. Each application might have its own queue. Events that are created from one application write certain a queue.

Message queues consist of publishers and consumers. What we call publishers leaves messages in the queue. Consumers also receive them and processed them. These are common patterns used in distributed systems.

These are the most well-known and being used as message queues; RabbitMQ, Kafka, ActiveMQ, AmazonSQS, IronMQ, Redis.

If Application 1 needs to send a message to Application 4, the message is written Queue A. As you see one more application can write the same queue. Message type does not need to be the same. You can manage it inside the consumer application. In fact, it connects two different services.

Message Bus may also come across under the name Service Bus. The Message bus provides us a messaging infrastructure for one or more applications to communicate messages to one or more other applications.

You can find differences between event and message in this article.

Message Bus does not guarantee first in first out. Subscribers subscribed to Message Bus can receive published messages without knowing about the publisher. These patterns also is known as pub/sub.

The message is published to the bus by the sending API, then any receiving API that has subscribed to any type of message will receive the corresponding message.

These are also the most well-known and being used as message queue; Microsoft Azure Service Bus, Oracle Enterprise Service Bus, Rabbitmq(MassTransit)

Message Bus

Publisher applications deliver their own state updates to the message bus. Subscribers who need this message receives this state updates from the message bus.

I hope I can clear your questions in your mind, and it will benefit you. If you like it, don’t forget to clap. Stay tuned! :)

Thank you for reading until the end. Please consider following the writer and this publication. Visit Stackademic to find out more about how we are democratising free programming education around the world.

--

--

Published in Stackademic

Stackademic is a learning hub for programmers, devs, coders, and engineers. Our goal is to democratize free coding education for the world.

Responses (3)