Akka - how to tell the system what to do after the strategy's max retries reached?
Asked Answered
S

1

7

Assuming the supervisor actor defined a certain strategy:

    private static SupervisorStrategy strategy =
        new OneForOneStrategy(10, Duration.create("1 minute"), DeciderBuilder.
                match(Exception.class, e -> resume()).
                matchAny(o -> escalate()).build());

And lets say the actor was instructed to resume, but failed for the 11th time within the current duration.

What happens now?

Is the parent actor is escalating the problem?

Can it now stop the actor somehow in an ordered way (e.g. tell the child actor to close connection to DB)?

Is there another overide method to call in this case?

Superinduce answered 16/8, 2017 at 6:0 Comment(1)
i tried deathwatch - from calling actor do context watch and pass the actor and handle terminated message but that's also not called when max retry is exceeded.Marnie
A
0

The actor's supervisor can send a message to the child to stop the DB when it received the escalation message from the supervised actor.

Asher answered 16/8, 2017 at 6:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.