lundi 25 avril 2016

Patterns for knowing if a pub-sub message was successful

I'm developing microservices for a project and we're experimenting with pub-sub communication using AWS SNS+SQS. We're unsure how to signal to services whether or not other services have successfully completed tasks or not.
For example, if service A emits an SNS Event and service D, E, and F all are listening to the subscribed SQS Queue, how does service A know if the activities kicked off by service A inside of service D, E, and F were successful?

I'll give a more concrete example: A new user registers for a website. This network call first reaches the user service in the backend. If the user was successful, it sends off an event saying a new user was created. That triggers the email service to send an email to for the user to confirm his registration. What happens if it fails to send an email? Has the user service:

1) Already responded to the frontend saying it was successful

2) Or is it waiting for a confirmation? What is a good pub-sub pattern for confirmations?

I know we could have just done a synchronous call, but this example is simplified for brevity's sake.

Aucun commentaire:

Enregistrer un commentaire