Javarevisited

A humble place to learn Java and Programming better.

Follow publication

Member-only story

Microservices Communication — part 2— Sync vs Async vs Hybrid?

Dineshchandgr - A Top writer in Technology
Javarevisited
Published in
10 min readMar 17, 2023

Hello Everyone. In the previous article, we saw that there are just between the services i.e . In the, we saw in detail the In this article, we are going to explore between microservices. We will see about three types of patterns used in async i.e . Then we will see that uses the combination of sync and async communication Toward the end of the article, we are going to see the use cases, benefits, and drawbacks of these different communication mechanisms. Let’s get started.

1. Synchronous Communication

Please check out Microservices Communication part 1 before you read this article.

2. Asynchronous Communication

In Asynchronous communication, a microservice sends a request to another microservice but it doesn’t wait for a response. Hence microservice A will not have a while waiting for a response from service B. It is a one-way communication and hence in nature. This will save a lot of resources and helps to perform efficient parallel processing.

We can easily handle multiple consumers at a time because it is loosely coupled. Service A does not know the whereabouts of Service B and its instances. It just pushes to the specific Queue and continues its job while Service B will have consumer polling for messages in the Queue. As soon as a message arrives in the Queue, it will be picked up by Service B and processed. in this pattern is also easy as we have ways to reprocess the messages.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Javarevisited
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.

Dineshchandgr - A Top writer in Technology
Dineshchandgr - A Top writer in Technology

Written by Dineshchandgr - A Top writer in Technology

Principal Software Engineer and Technical Lead focussed on Backend Engineering who likes to upgrade the tech skills and share knowledge to the community

No responses yet