How to handle tell/ask failure of Akka peers?

205 views Asked by At

Java API here. Brand new to Akka, and trying to understand how its Fault Tolerance model applies to actor messaging that falls outside the parent/child or supervisor/supervisee pattern.

If my understanding of Akka is correct, one actor can communicate (via ask(...) and tell(...)) with another actor even if its not that other actor's supervisor. So to me, this means you can have "peer actors" communicating with each other. For instance, perhaps a FizzRouter is an actor that is the supervisor of, say, 20 FizzActor instances. But each of those FizzActor instances may communicate (tell/ask) with lots of other types of actors, that are merely peers and not their actual supervisor.

So SupervisorStrategies are wonderful for mapping Throwables to Directives (stop, restart, resume, escalate), when a (supervised) child is failing. But how do we handle failure when a tell or ask to one of our so-called "peer" actors throws exceptions? What would this code look like (again, Java API here)?

0

There are 0 answers