Prog_G
Prog_G

Reputation: 1615

How to recover Message if akka actor goes down for some reason?

I want to solve two scenarios :

  1. I have a sender Actor and a Receiver Actor how will the sender actor know that the receiver actor is not responding.Terminated case' can be used to get a notification but what is the latency or the response time of Terminated message. I can't miss even a single message.
  2. How can I recover the messages that are currently in the mailbox of the terminated actor?

Upvotes: 1

Views: 63

Answers (2)

Levi Ramsey
Levi Ramsey

Reputation: 20551

Note that since the time this question was asked, Akka 2.6 introduced (though the API is subject to change) opt-in support for reliable delivery. When combined with a durable producer (i.e. one which defines a unique persistence ID and writes messages to durable storage), this can guarantee that sent messages are eventually delivered, at the cost of dramatically decreased throughput (and/or substantial persistence expense).

Upvotes: 0

Rob Crawford
Rob Crawford

Reputation: 556

You will need to develop your own protocol for acknowledging messages and that they've been processed, and retrying those that haven't been processed. See:

https://doc.akka.io/docs/akka/current/general/message-delivery-reliability.html

it is always possible to add stronger reliability on top of basic ones, but it is not possible to retro-actively remove reliability in order to gain more performance.

Upvotes: 3

Related Questions