Skip to content

Instantly share code, notes, and snippets.

@Horusiath
Horusiath / example.cs
Last active April 17, 2022 10:27
Generic persistent gateway for Akka.NET at-least-once-delivery semantics
// Delivery mechanism looks like this - if sender wants to reliably deliver payload to recipient
// using at-least-once delivery semantics, it sends that payload wrapped to Messenger actor, which
// is responsible for the persistence and redelivery:
//
// +--------+ +-----------+ +-----------+
// | |--(DeliverOrder<T>)-->| |--(Delivery<T>:1)-->| |
// | | | | /* 2nd attempt */ | |
// | Sender | | Messenger |--(Delivery<T>:2)-->| Recipient |
// | | | | | |
// | | | |<----(Confirm:2)----| |