Spring's @Retryable annotation will retry three times (default) and fallback to the @Recovery method. @CircuitBreaker however, will retry once and fall back when the state is closed.
I want to combine these two: when the circuit breaker state is closed, will retry three times before falling back (to deal with transient errors), if the state is open, will directly fall back.
Any elegant way to do this? A possible approach is to implement the retry logic inside the function, but I feel that it wouldn't be the best solution.