14 ms·
I deal with it in the following way: External calls are only triggered on Commands, never on events. In order to achieve this, I use process manager. Say the
by leifg 8y ago
I deal with it in the following way: External calls are only triggered on Commands, never on events.
In order to achieve this, I use process manager.
Say the event "User Signed Up" is dispatched. A process manager will then execute the "Send Welcome Email", the aggregate checks if the user aggregate root is in a state where a welcome email should be sent (something like a flag `welome_email_sent`). Depending on the result of your email provider, the event "WelcomeEmailSuccessfullySent" or "WelcomeEmailNotSent".
It is possible to react to the erroneous event with another process manager and retry.
- deleted 8y ago[deleted]