This article is the third in a series dedicated to the ESB integration architecture. The initial article is located here.
Point-to-Point asynchronous messaging
In my previous article, I talked about 3 limitations of a traditional integration:
- Lack of scalability and fault tolerance.
- There are no economies of scale.
- Sender and receiver are tied by a contract.
In this article, I will describe a form of asynchronous messaging called Point-to-Point.
Point-to-Point asynchronous messaging solves limitation #1. It does so by the introduction of a messaging layer, often referred to as a message bus or event bus and the use of queues. It is still a one-to-one delivery though, similar as traditional integration.
A couple of advantages of this model:
- Senders and receivers are now physically loosely coupled. For example, if the receiver is down, or slows down (the receiver is still working but it is not able to accept the messages as quickly as they are being sent because it is not sized appropriately for example) the messaging layer can still receive messages and hold them until the receiver is ready to consume them, effectively playing a regulating role.
- Scalability and fault tolerance are built-in the model: persistence layer (file or database), vertical scalability since the bus is running on a separate set of servers that can be scaled separately from the sender or receiver, horizontal scalability through the ability to create multiple reception threads.
However, this form of messaging still does not allow for economies of scale as there can be only one receiver for a given message. It also ties all parties to a data schema and any change to this schema often requires all parties to be involved.
When to use
This model is typically used to facilitate communication between 2 components (whether they are tightly coupled or written in a different language/technology platform), and/or when you need to ensure a message is processed by one receiver only. If multiple receivers point to the same queue, only one will dequeue it and the message will be removed once acknowledged.
In the next article, I will discuss alleviating limitation #2 above through Publish-Subscribe asynchronous messaging.
If have any questions, feel free to leave a comment below or contact us here.