# 1. RetryTemplate around the call (org.springframework.core.retry, spring-core 7.0.10)
get("tpl", failures=2) -> 'Recovered on call 3'
stub saw 3 calls; listener events: [beforeRetry, onRetryFailure(ServiceUnavailable), beforeRetry, onRetrySuccess]
maxRetries(2) against a dead upstream -> HttpServerErrorException$ServiceUnavailable / 503 Service Unavailable: "{"type":"https://stub.example/problems/service-unavailable","title":"Service Unavailable","status":503,"detail":"Flaky upstream, call 3","instance":"/flaky/exhaust"}"
stub saw 3 calls
execute() instead of invoke() -> RetryException, retryCount=2, exceptions=3, last=ServiceUnavailable

# 2. @Retryable on the @HttpExchange interface method (bean from the "flaky" group)
get("ann", failures=2) -> 'Recovered on call 3'; stub saw 3 calls
get("ann-dead", failures=10) -> HttpServerErrorException$ServiceUnavailable / 503 Service Unavailable: "{"type":"https://stub.example/problems/service-unavailable","title":"Service Unavailable","status":503,"detail":"Flaky upstream, call 4","instance":"/flaky/ann-dead"}"
stub saw 4 calls (maxRetries = 3)

# 3. the same retry as a ClientHttpRequestInterceptor on the "resilient" group (idempotent methods only)
get("icpt", failures=2) -> 'Recovered on call 3'; stub saw 3 calls; interceptor attempts so far: 3
POST createUnstable -> HttpServerErrorException$ServiceUnavailable / 503 Service Unavailable: "{"type":"https://stub.example/problems/service-unavailable","title":"Service Unavailable","status":503,"detail":"Created, but the response was lost","instance":"/posts/unstable"}"
stub created the resource 1 time(s): the interceptor did not retry a POST

# 4. the trap: @Retryable on a POST whose response was lost after the server did the work
createUnstable() -> id 102, body 'created 2 times so far'
stub created the resource 2 times for ONE logical call

# 5. Resilience4j 2.4.0 around the same plain client
maxAttempts(3), failures=2 -> 'Recovered on call 3'; stub saw 3 calls
maxAttempts(3) against a dead upstream -> ServiceUnavailable; stub saw 3 calls
