4

In Akka, when an actor dies while processing a message (inside onReceive(...) { ... }, that message is lost. Is there a way to guarantee losslessness? Is there a way to configure Akka to always persist messages before sending them to onReceive, so that they can be recovered and replayed when the actor does die?

Perhaps something like a persistent mailbox?

smeeb
  • 27,777
  • 57
  • 250
  • 447

1 Answers1

4

Yes, take a look at Akka Persistence, in particular AtLeastOnceDelivery. This stores messages on the sender side in order to also cover losses during the delivery process, because otherwise the message might not ever reach the destination mailbox.

Roland Kuhn
  • 15,412
  • 2
  • 36
  • 45
  • Thanks @Roland Kuhn (+1) - is `AtLeastOnceDelivery` available to the Java API? In the docs it's mentioned as a trait/mixin which makes it sound like its only available to Scala. Thanks again! – smeeb Jun 08 '15 at 00:57
  • Check out the Java documentation then: http://doc.akka.io/docs/akka/2.3.11/java/persistence.html#At-Least-Once_Delivery – Roland Kuhn Jun 08 '15 at 06:53