I'm working with the Akka Java library (unfortunately, the Classic version). When implementing the fault tolerance Strategy, the documentation provide a snippet like this:
private static SupervisorStrategy strategy =
new OneForOneStrategy(
10,
Duration.ofMinutes(1), // <----- Note here!
DeciderBuilder.match(...)
.build();
Moreover, it says:
"Also, there are special values for these parameters. If you specify:
-1
to maxNrOfRetries
, and Duration.Inf()
to withinTimeRange
, then the child is always restarted without any limit".
The problem is that, in my Java (openjdk-11), Duration.Inf()
doesn't actually exist!.
I have read some SO answers that specify what is the effective maximum Duration, but Akka seem to not recognize them. The best I could do is to specify Duration.ofNanos(Long.MAX_VALUE)
.
Am I missing something? Is there actually a value to input or is the Akka documentation just wrong?