-
Notifications
You must be signed in to change notification settings - Fork 60
Reliable Delivery
Reliable delivery is guaranteed by the Akka-DDD framework between the Receptor and the Process Manager (events delivery) as well as between the Process Manager and the Aggregate Root (commands delivery).
To support the At-Least-Once
delivery semantics (which is the ground for the reliable delivery) the sender should mix in the AtLeastOnceDelivery
trait.
The At-Least-Once
delivery implies that the original message send order is not always retained and the destination may receive duplicate messages due to possible resends.
As long as the actions, that the receiver takes to process the messages, are idempotent, the duplicate messages are not a problem.
Otherwise the receiver should obtain the identifier of the received message and attach it to the event message (as a CausationID
meta-attribute) that gets written to the receiver journal. The receiver should now be able to recognize an incoming message as a duplicate by checking if its ID is one of those IDs collected in the past. Obviously, the duplicate message should not be processed by the receiver. Still, the acknowledgment (delivery receipt) should be sent to the sender.
Akka-DDD provides the Deduplication trait that implements the logic of the deduplication as described above. The trait is mixed in by Aggregate Root and Process Manager.
TO BE CONTINUED...