snowe
12/29/2023, 2:02 AMonRetry
blocksnowe
12/29/2023, 2:03 AMval failsafeExecutor = Failsafe.with(
Fallback.of(Response(OK).body("Fallback")),
RetryPolicy.builder<Response>()
.withMaxAttempts(5)
.handleResultIf { !it.status.successful }
.onRetry { result ->
<http://logger.info|logger.info> { "${result.attemptCount} Retry is occurring ${result.isRetry}" }
<http://logger.info|logger.info> { "${result.lastResult} " }
}
.build(),
CircuitBreaker.builder<Response>()
.withFailureThreshold(1)
.handleResultIf { it.status.serverError }
.build(),
Timeout.of(Duration.ofMillis(100))
)
I’m pretty sure I’m not doing anything wrong here. I checked the failsafe docs and it says this is how it should work, but that the circuit breaker should stop the retries.dave
12/29/2023, 11:56 AMsnowe
12/29/2023, 4:30 PMsnowe
12/29/2023, 4:42 PM