You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, @CircuitBreaker always wraps failures into into an ExhaustedRetryException. This hides the true nature of the failure and makes it furthermore impossible to figure out whether the circuit breaker is actually open or not.
Having e.g. a @Recover-method just to unwrap and rethrow exceptions seems not a proper way to go... it also doesn't solve the circuit breaker status issue.
The only currently available alternative is to implement a custom circuit breaker RetryTemplate which feels odd.
Please fix.
The text was updated successfully, but these errors were encountered:
jbspeakr
changed the title
Make Exception-wrapping configurable
Rework Exception-wrapping
Jun 27, 2017
It's not really a @CircuitBreaker feature is it (the RetryTemplate always wraps the last failed exception)?
It has been like that since the beginning, and therefore there might be reasons and also people relying on the behaviour, so "please fix" is kind of irresponsible. If you have a concrete suggestion about how to evolve the code please feel free to comment or send patches.
@dsyer
Hi, dsyer
About the issue, I make a pull request #133 .
I add an option on the @Retryable to decide whether the original exception will be thrown .
Please review, thanks!
…austed()`
Fixes: spring-projects#82
There are some use-cases when `ExhaustedRetryException` does not fit into the logic around Circuit Breaker pattern.
The `RetryTemplate` has already a `throwLastExceptionOnExhausted` flag for stateful retries
* Expose `@CircuitBreaker.throwLastExceptionOnExhausted()` and propagate it down to the `RetryTemplate`
in the `AnnotationAwareRetryOperationsInterceptor`
Currently,
@CircuitBreaker
always wraps failures into into anExhaustedRetryException
. This hides the true nature of the failure and makes it furthermore impossible to figure out whether the circuit breaker is actually open or not.Having e.g. a
@Recover
-method just to unwrap and rethrow exceptions seems not a proper way to go... it also doesn't solve the circuit breaker status issue.The only currently available alternative is to implement a custom circuit breaker
RetryTemplate
which feels odd.Please fix.
The text was updated successfully, but these errors were encountered: