akka - Overriding balancing pool router supervisor strategy doesn't work -
my worker code:
def receive = { case msg => throw new exception("test exception escalation") }
my controller (parent) code:
val strategy = oneforonestrategy() { case _: exception => escalate case _ => escalate } val router: actorref = context.actorof(props[worker].withrouter(fromconfig().withsupervisorstrategy(strategy)), name = "router") def receive = { case ex: exception => log.info(ex.tostring) }
however, whenever send message worker, restarts instead of escalating parent. seems overriding not working.
any idea please? thanks!
escalating failure not mean exception sent message parent actor the parent actors supervision strategy used determine do.
your controller/parent actor not override supervisionstrategy
, therefore has default strategy restart on exception.
Comments
Post a Comment