How to prevent duplicate commands from being executed by an aggregate.
Use a router middleware to record the identity of each successfully dispatched command and prevent duplicates. Record the causation_id for each event applied to an aggregate and reject commands that have already be seen (caused an event to be recorded).
How to prevent duplicate commands from being executed by an aggregate.
Use a router middleware to record the identity of each successfully dispatched command and prevent duplicates. Record the
causation_id
for each event applied to an aggregate and reject commands that have already be seen (caused an event to be recorded).