zegulas
zegulas

Reputation: 417

Client to API gateway communication in microservices architecture

I have read a couple of articles which tells us about the communication between microservices, I have chosen the event based communication between microservices pattern, but now I am wondering how the client is supposed to communicate, if it sends a request to the API gateway, should it wait for a response (which might take time due to the event based nature of communication between the microsrvices internally) or should it say "processing" and do polling to check if the request was completed?

What is the standard practice for client --> api gateway --> microservices communication?

Upvotes: 0

Views: 478

Answers (1)

Seth
Seth

Reputation: 481

Most of the time you will find that Clients --> API Gateway --> Microservice communication is actually synchronous, which means that client would need to wait and block until a response is received. Typically it is implemented as a HTTP based call that the client fires to the API gateway and then reaches the microservice at the back. This doesn't seem to be the kind of event based communication that you are talking about.

The standard practice for event based communication would be something like : Client --> Event/Message Broker --> Microservice this is an asynchronous approach where the Client doesn't block/wait for a response. However, the client would need to have a back channel event handling process that is listening to the communication to handle the response that comes back from the microservice. Microservice --> Event/Message Broker --> Client.

Upvotes: 1

Related Questions