spring-retry icon indicating copy to clipboard operation
spring-retry copied to clipboard

Make Retry and Circuit Breaker composable

Open jbspeakr opened this issue 7 years ago • 1 comments

I want to achieve following behaviour: Specific execution failures are first retried according to e.g. a SimpleRetryPolicy, then if the policy is exceeded the failure is recorded by the CircuitBreaker.

Although both SimpleRetryPolicy and CircuitBreakerPolicy implement RetryPolicy and can be used to forge a CompositeRetryPolicy, this seems not to be an intended use-case for Spring Retry.

It feels like the reason for this is that stateful (CircuitBreaker) and stateless retries are not (yet?) composable due to some shared global state. Or am I missing something?

jbspeakr avatar Jun 27 '17 11:06 jbspeakr

Seems like a reasonable goal theoretically. But why would you not just change the parameters of the circuit breaker? What is the benefit of a composite that you don't get from a delegation model (as is already implemented in CircuitBreakerRetryPolicy)?

dsyer avatar Dec 12 '17 09:12 dsyer