Asynchronous communication

In asynchronous communication, unlike the synchronous service, there is no waiting for a response from the called service. In this pattern of communication, the calling service publishes its request and continues the rest of the work. In the same way, the calling service also has one listener inside itself, which will listen to a request generated by other services for this service. It captures those requests and processes it. The main benefit of this pattern is that it is non-blocking and does not wait for a response. Normally, the message broker is used for communication in this kind of pattern. The calling service is just interested in the message being delivered until the message is broken, and then it continues to its work. This way, even if the called service is not up, it doesn't affect the calling service. It makes the service more decoupled, and it need not know of the existence of the other service.

This kind of pattern basically works on the assumption that in one service, during the processing of its own request cycle, it doesn't need some data from another service. Rather it triggers the other service after completing its own request cycle. If the service needs data, which is with some other service, it replicates it in its own context by receiving a message from that domain. We define eventual consistency as follows.

Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset