I am not sure what approach to follow for Akka supervision.
I have an Akka actor that lists files from a FTP server when a message triggers it. If the connection is broken, the actor will fail with an exception (say, IOException) which will trigger supervision. At this point, I see two alternatives:
- I keep resuming / restarting the actor until the server comes back up, maybe with an exponential backoff
- I set parameters (such as maxNrOfRetries = xy) in a way that the supervisor will give up and stop the actor after xy times
The first strategy seems wasteful, but the second one seems to bring another issue: how would the actor be eventually restarted? I have the feeling that tuning the parameters of the Backoff supervisor is the best way to go, but maybe I'm missing something?