1

Akka docs say to configure

akka.actor.guardian-supervisor-strategy, which takes the fully-qualified class-name of a SupervisorStrategyConfigurator

SupervisorStrategyConfigurator is a trait. Do I need to extend any classes with my subclassed trait? Or do I just define the trait and specify it in the configs, causing Akka to generate the guardian actor with that trait?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
kliew
  • 3,073
  • 1
  • 14
  • 25

1 Answers1

1

The default value of akka.actor.guardian-supervisor-strategy is "akka.actor.DefaultSupervisorStrategy"(It is also default for any actor created without a specific supervisorStrategy). There are two known subclasses of SupervisorStrategyConfigurator (DefaultSupervisorStrategy and StoppingSupervisorStrategy). You can see the source code here.

If you want a custom one you need to extend SupervisorStrategyConfigurator and specify in the config file. An example for configuration:

akka.actor.guardian-supervisor-strategy = "com.example.MySupervisorStrategy"
ulas
  • 463
  • 5
  • 10