Yuiry.Vasilyev
Yuiry.Vasilyev

Reputation: 320

How-to enable message persitence for akka.net

all

Is it possible to store akka.net actors inbox messages in database? What will happen if host with akka.net system crash?

Upvotes: 3

Views: 375

Answers (1)

Bartosz Sypytkowski
Bartosz Sypytkowski

Reputation: 7542

Persisting messages is only part of the bigger issue, which is reliable message processing. In short the goal is not only to persist messages, but usually to guarantee that message has been received and correctly processed. By default Akka.NET uses at-most-once delivery semantic, which means, that messages are processed using best effort politics. This allows to keep high throughput and keep actors behavior away from being idempotent. However sometimes we need a higher reliability for some of the messages.

One of the techniques is to use another reliable queue (such as RabbitMQ or Azure Service Bus) in front of your actor system and use it for reliable messaging.

Other solution is to use AtLeastOnceDeliverySemantic actors from Akka.Persistence library. Here you may specify actor responsible for re-sending and confirming processed messages. From there you may decide to persist incoming messages using eventsourcing primitives build into Akka.Persistence itself. Persistence backend is plugable in this scenario.

Upvotes: 6

Related Questions