Re:Failsafe – failure handling with retries, circuit breaker...
by bhntr3 on Saturday July 23, 2016 @08:23PM
(#12151630)
They have a CircuitBreaker. They don't seem to have exponential backoff. But that seems close to correct. For a networked application, what do you think is safer than retrying with exponential backoff and circuit breaking?
[ Parent
| on HN ]
Re:Failsafe – failure handling with retries, circuit breaker...
by jodah on Saturday July 23, 2016 @09:34PM
(#12151803)
Author here, Failsafe does support exponential backoffs [1]:
retryPolicy.withBackoff(1, 30, TimeUnit.SECONDS);
and if you want to specify the exponent [2]: retryPolicy.withBackoff(1, 30, TimeUnit.SECONDS, 1.5);
As for which failure handling strategy is safer or what it means to fail safely, in my experience it not only depends on the use case but the type of failure. Certain exceptions, even in a networked application, can and should be retried or recovered from while others cannot. Sometimes retrying is good, sometimes preventing subsequent executions (via circuit breakers), sometimes falling back to an alternative resource. It's all based on the scenario.[1]: http://jodah.net/failsafe/javadoc/net/jodah/failsafe/RetryPo...
[2]: http://jodah.net/failsafe/javadoc/net/jodah/failsafe/RetryPo...