Hi, You should be able to do that from your SupervisorStrategy decider. I could not find a way to subclass OneForOneStrategy from Java to hook in at the right place, so you have to do your own bookkeeping of restarts within time window in the decider. That probably means that your decider should return restart() or stop() based on your restarts within time window logic.
Regards, Patrik On Tue, Jun 10, 2014 at 9:44 PM, Swathi Sri Kondagari < [email protected]> wrote: > Can any one tell me the way to differentiate the two scenarios to a call > to the poststop() method: > > 1. When the Supervisor reaches a maximum number of retries to restarting a > child actor due to an error in the child actor. > 2. When a poisonpill is called or the actor system is shut down. > > I am trying to implement a scenario where i can send an error message to > the system as a service call or a message in an error queue when the > maximum number of retries for restarting a child actor is acheived. Can > someone tell me if the supervisor or the child class can capture the > scenario where the system stops restarting a failed child class to a > failure in the message sent in. > > In short is there any way to implement a scenario like this in 2.3 version > of akka? > > http://doc.akka.io/docs/akka/1.3.1/java/fault-tolerance.html > > 1. Procedure2<ActorRef, MaximumNumberOfRestartsWithinTimeRangeReached> > handler = new Procedure2<ActorRef, > MaximumNumberOfRestartsWithinTimeRangeReached>() { > 2. public void apply(ActorRef ref, > MaximumNumberOfRestartsWithinTimeRangeReached max) { > 3. EventHandler.error(ref, max); > 4. } > 5. }; > > -- > >>>>>>>>>> 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. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw <http://www.scaladays.org/> -- >>>>>>>>>> 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.
