Search code examples
azure-service-fabricreliable-actors

Are messages in the mailbox from Reliable Actors stateful?


The state of Reliable Actors including reminders are restored whenever a primary node fails. I could however not find any information regarding messages in the mailbox. What happens with these messages, are they lost or does the actor restore these messages?

The only information I could find is the following:

Because the actor service itself is a reliable service, all the application model, lifecycle, packaging, deployment, upgrade, and scaling concepts of Reliable Services apply the same way to actor services.

I'm not sure if the above quote includes messages from a mailbox from an actor.

https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-actors-platform


Solution

  • SF Reliable Actors does not use the same mailbox messaging approach like Akka.

    Akka uses the TELL approach where the messages are sent to the actor and stored in a mailbox for processing, once the processing is complete the actor send a message to the caller with an answer.

    SF uses the ASK approach, where the caller keep waiting for the answer, so there is no mailbox, the processing will happens according to the locking order taken from the actor, if the actor service fails, the calls and locks will be dropped.

    Because the calls and retries to the actors are managed by the caller, using the ActorProxy, it will resend the call, and it will get to a new service instance\replica, consequently getting a new priority order than before.