NEEDS OF MESSAGING FRAMEWORKS

Hansini Rupasinghe
5 min readMay 16, 2021

--

What is a Message Broker?

❋ A message broker is an inter-application communication technology that helps in enabling systems, applications and services to communicate with each other and interchange data and information.

❋ It can be known as a mechanism used in integration to assist cloud architectures such as server-less, cloud native, microservices-based and hybrid.

❋ Message brokers can be referred to as software modules within messaging middleware which translates messages between formal messaging protocols.

❋ No matter what the underlying platform or the implemented language is, message brokers are capable of communicating among independent services directly.

❋ It is also a discrete service where the source application, that is also known as the producer, sends a message to a server process that is capable of routing, providing data marshaling, message translation, persistence and delivery to all the necessary destinations (consumers).

❋ There are two forms of Message Broker Models.

1. Point-to-point communication

💮 It is a one-to-one relationship which has one sender and one receiver.

💮 Point-to-point messaging is used when a sender needs to send a message to a receiver.

💮 This messaging style uses a queue to keep messages sent by the sender until they are received by the receiver.

💮The process happening when using point-to-point communication is that the message producer sends the message to the queue and the message consumer retrieves messages from the queue and sends acknowledgment that the message was received.

Ex: payroll and financial transaction processing(both senders and receivers must be guaranteed that each payment will be sent only once)

2. Publish and Subscribe Messaging

💮 This is a broadcast type distributed messaging pattern where the producers are sending messages on a specific topic.

💮 Here, the producer is known as the publisher while the receiver is known as the subscriber.

💮 In this method, producer publishes a message as a topic, and multiple message consumers subscribe to the topics that they want to receive messages from.

Ex: Airline Management system ( Multiple people can get information about updates about the landing times or delay status of its flights)

Examples of Message Brokers

1. Apache Kafka

● Kafka was initially developed by LinkedIn using Java which is now working under the Apache project umbrella.

● Kafka has implemented publish-subscribe messaging that is a better way for integration and communication between components of large-scale data systems in real-world data systems.

● The architecture of Kafka has built in a way where it stores the messages in flat files using a persistent commit log and messages are requested by consumers as offsets.

● And also it operates as a cluster that can be consumed by many clients.

● Horizontal scaling is done easily and it provides guarantee for fault tolerance when machine fails.

Benefits of Kafka

🔆 Scalable

🔆 Reliable

🔆 High Throughput

🔆 Fault tolerance

🔆 Durable

🔆 High Concurrency

🔆 Powerful event streaming platform

🔆 Suitable for real time processing

Disadvantages of Kafka

⚙️ Behaves Clumsy

⚙️ Problems with Message Tweaking

⚙️ No Complete Set of Monitoring Tools

⚙️ Do not support wildcard topic selection

2. RabbitMQ

● RabbitMQ is the most popular and well known message broker which has deployed open source.

● This has written using Erlang language and RabbitMQ supports both persistent and non-persistent delivery.

● In order to guarantee delivery, these brokers use message acknowledgements.

● It can be known as a middleware layer that supports different services in your application to communicate with each other without any message loss.

● It also facilitates efficient message routing while enabling extensive decoupling of applications.

Ref: https://www.cloudamqp.com/blog/part1-rabbitmq-for-beginners-what-is-rabbitmq.html

Benefits of RabbitMQ

🔆 Ease of configuration

🔆 Easy to set-up and start

🔆 Durable

🔆 Works with good metrics

🔆 Completeness of messaging patterns

Disadvantages of RabbitMQ

⚙️ High Latency

⚙️ Non-transactional

3. ActiveMQ

● ActiveMQ is a message-oriented middleware which has been designed in order to send messages between two or more applications.

● The architecture of ActiveMQ consists of data patterns called messages, queues and topics.

● It can be considered as one of the ideal solutions when considering the number of connection protocols used and the highly normalized connection points between applications that are coded in different languages, such as Java, C++, .NET etc.

Benefits of ActiveMQ

🔆 Support for multiple connection protocols.

🔆 The product is actively maintained.

🔆 Web UI for queue management.

🔆 Dynamic queue creation.

Disadvantages of ActiveMQ

⚙️ Messages must be sent to either queues or topics.

4. NSQ

● NSQ is a distributed real-time messaging platform which was initially designed to be an in-memory message queue.

● It is written in Go language and contain key features such as single point failure, high availability, reliable message delivery and fault tolerance.

● It consists of a de-centralized topology and aids in infinite horizontal expansion.

● Although order of delivery is not assured, NSQ utilizes acknowledgements to guarantee message delivery.

Benefits of NSQ

🔆 Easy to configure and deploy

🔆 Supports various messaging protocols

🔆 Supports a variety of clients

🔆 High throughput

🔆 Save data if subscribers could not find

Disadvantages of NSQ

⚙️ Lacks durability

⚙️ No built-in replication

References

--

--