Hi Steven, Am Dienstag, 29. Juli 2014 14:58:53 UTC+2 schrieb Steven: > > Hi, > I’ve been doing a lot of reading into the Akka framework and have played > with a few of the examples, and sort of understand is ‘embrace failure’ and > ‘self heal’ ethos. > But I have a use case using ‘exactly-once’ message delivery and I can’t > see how to get Akka to handle failure or self heal. > > My example. > There is a simple work Queue that the main master actor (A) gets work from > and hands it to actors that may or may not be in the same JVM, > > Worker (w) in the same JVM dies and this is spotted by (A), (A) knows what > message was sent to work (w) and can resend to worker (y). > This also works for separate JVM’s > > But if worker (x) is on a separate JVM, and while it was processing, the > JVM in which the master Actor(A) is running in, dies. > now worker (x) now completes its work but has no master actor to > communicate too. what should it do? > Also when Master (A) comes back up, it has no knowledge of which actors > are processing what messages, as they have already been removed from the > queue. > > This led me to persistence, which was sort of what the queue was already > supposed to be providing. > So master (A) removes the work from the queue and sends a msg to worker(x) > on a remote node and stores that assignment in persistent storage. so if > master (A) dies, when it comes back up it knows what _was_ in progress, but > it currently doesn’t know which actors are (still running/also died/ > waiting for work). and if we also persist the msg on the worker(x) side, > how do we guarantee that the correct number of workers are restarted with > the correct ID's to retrieve their previous msg. > As long as the master keeps track of the workers and uses names for the workers it should not be a problem. When a worker has crashed the master could detect that and start a new worker with the same name and persistence id so that the worker can recover the state with the previous messages. In order to avoid stale ActorRefs after a crash you could store the paths of the actors or just their names. From the path you can get an actorSelection (which is the replacement for actorFor that was deprecated in 2.2). ActorSelection can be used to send messages. You cannot watch actorSelections, so on recovery you would probably try to get ActorRefs for all actorSelections and register to watch them.
> > I’m just lost as to how to use akka to properly handle and recover from > this failure scenario. > > I’m hoping I’m missing something obvious and can anyone help elaborate. > Thanks, > Steven. Hope that helps. Cheers, Michael -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
