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.
- Public API - exposing the email functionality to public
- Validation API - to validate the genuineness of the email and other fields
- Template fetching API - fetch the email templates from database/CMS and prepare the final content to be sent
- 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