- Discussion
- Useful Resources
- Quick Guide
- Blue Green Deployment
- Circuit Breaker
- Service Discovery
- External Configuration
- Health Check
- Distributed Tracing
- Performance Metrics
- Log Aggregation
- Event Sourcing
- Aysynchronous Messaging
- Saga
- Command Query Responsibility Segregator
- Shared Database per Service
- Database per Service
- Branch
- Chain Of Responsibilities
- Client Side UI Composition
- Proxy
- Aggregator
- API Gateway
- Decompose by Strangler
- Decompose by Subdomain
- Decompose by Business Capability
- Microservices Design Patterns - Overview
- Microservices Design Patterns - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Aynchronous Messaging
Problem Statement
Microservice architecture structures an apppcation as a set of loosely coupled microservices and each service can be developed independently in agile manner to enable continous depvery/deployment. Microservices handle requests from cpents and often need to communicate with other microservices to fulfill the requests. So there is a requirement for inter-process communication protocol.
Solution
We can use Aynchronous Messaging Pattern for inter service communication as using synchronous communication will result in tight couppng of services and also requires both cpent and service to be available during request.
Using Aynchronous Messaging, a service can communicate by exchanging messages over messaging channels. Following are some of the different ways of asynchronous messaging communications.
Request / Synchronous Response − In this method, service makes a request to another service and expects a reply promptly.
Notifications − In this method, service sends a message to a recipient but is not expecting any response. Recipient is not expected to send a response as well.
Request / Aynchronous Response − In this method, service makes a request to another service and expects a reply within reasonable timeframe.
Pubpsh / Subscribe − In this method, service pubpshes a message to zero or more recipients. Services which subscribe the message will receive the same. No response needed.
Pubpsh / Aynchronous Response − In this method, service pubpshes a message to zero or more recipients. Services which subscribe the message will receive the same. Some of the them sends back an acknowledgement/reply.
Example
RabbitMQ and Apache Kafka are good examples of asynchronous messaging in microservices arena.
Advertisements