Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to recover messages in Akka Actors now that Durable Mailboxes are removed?

Tags:

scala

akka

I was working with the latest version of Akka when I noticed that durable mailboxes are now removed from Akka.

I need to make sure that my messages are recovered upon a restart after crash. Is there an alternate way to work without durable mailboxes or a custom implementation by someone else.

I also tried Akka Persistence but it replays the messages and I don't want to send the same messages twice in the event of a crash given that all messages are expensive to perform.

like image 238
chbh Avatar asked Sep 18 '15 11:09

chbh


1 Answers

While this is not exactly a solution to work with Akka Actors, it does solve the original problem in question here.

Instead of using Akka here, I believe it's a better idea to use something like Kafka along with reactive streams with something like akka/reactive-kafka.

A system like that is very good for persistence, and offers very good semantics for preserving the message queue on a crash. This is way better than storing the message somewhere that is to be processed, and in general performs better.

It does not have to be Kafka, but any backend that can plug with a reactive stream (Akka's implementation or otherwise).

like image 78
Chetan Bhasin Avatar answered Nov 15 '22 20:11

Chetan Bhasin