mardi 29 mars 2016

Acknowledgement to clients on asynchronous microservice

I read everywhere that service to service calls should be asynchronous in microservices. When the request has to pass through 2 or more async services, how can we do the client acknowledgement?

Here is my real time scenario. We are developing an email sending functionality in our organisation. We are planning to have 4 API services for this in the following order.

  1. Public API - exposing the email functionality to public
  2. Validation API - to validate the genuineness of the email and other fields
  3. Template fetching API - fetch the email templates from database/CMS and prepare the final content to be sent
  4. Email sending API - will receive the recipient and the email content

The problem is, we have to acknowledge the client who initiated the request with some id if successful, otherwise have to return the error code. If we have to adapt the best practice of making asynchronous service to service call, how we can acknowledge the client from Email sending API(final API)?

Aucun commentaire:

Enregistrer un commentaire