BackoffSupervisor maxNrOfRetries

32 views
Skip to first unread message

Giovanni Alberto Caporaletti

unread,
Jun 24, 2016, 10:03:46 AM6/24/16
to Akka User List
Hi, is there a way to set a maxNrOfRetries for BackoffSupervisor?

.withSupervisorStrategy(OneForOneStrategy(maxNrOfRetries = 1)(SupervisorStrategy.defaultDecider))))

doesn't seem to work, for example the following restarts the actor indefinitely:


system.actorOf(BackoffSupervisor.props(Backoff.onFailure(
Props(new Actor {
self ! "test"
def receive = { case x => throw new Exception("error") }
}),
"test", minBackoff = 100.millis, maxBackoff = 1.second, randomFactor = 0.2

).withSupervisorStrategy(OneForOneStrategy(maxNrOfRetries = 1)(SupervisorStrategy.defaultDecider))))


cheers
G

Patrik Nordwall

unread,
Jun 27, 2016, 8:39:27 AM6/27/16
to akka...@googlegroups.com
I think there is an issue for this, with a Pull Request in progress: https://github.com/akka/akka/issues/20597

--
>>>>>>>>>> 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 akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.



--

Patrik Nordwall
Akka Tech Lead
Lightbend -  Reactive apps on the JVM
Twitter: @patriknw

Reply all
Reply to author
Forward
0 new messages