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?

t-rex-50
  • 201
  • 1
  • 4
  • 10
  • 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. – h.alex Oct 07 '18 at 23:13

1 Answers1

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.

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52