Companion code for "Spring Framework 7's Built-in Resilience: @Retryable, @ConcurrencyLimit, and What's Left for Resilience4j". Every retry counted by recording real invocations: defaults, backoff and jitter, timeout, reactive and CompletableFuture returns, the concurrency limit's BLOCK and REJECT policies, retries around transactions, composition with Resilience4j 2.4.0, and the annotation API across 7.0.0-7.0.9. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01C3TETMrqVUWeFkNtz3Jbo3
46 lines
2.0 KiB
Markdown
46 lines
2.0 KiB
Markdown
# 1. What Spring Framework 7 ships
|
|
|
|
[Index](../README.md) · Next: [2. Enabling →](02-enabling.md)
|
|
|
|
| Piece | Package | Jar |
|
|
|---|---|---|
|
|
| `@Retryable`, `@ConcurrencyLimit`, `@EnableResilientMethods` | `org.springframework.resilience.annotation` | spring-context |
|
|
| `MethodRetryEvent`, `MethodRetryPredicate`, interceptors | `org.springframework.resilience.retry` | spring-context |
|
|
| `InvocationRejectedException` | `org.springframework.resilience` | spring-context |
|
|
| `RetryTemplate`, `RetryPolicy`, `RetryListener`, `RetryException` | `org.springframework.core.retry` | spring-core |
|
|
|
|
## Defaults, read from the annotations
|
|
|
|
Reflection over `Retryable.class.getDeclaredMethods()` on 7.0.9
|
|
([`ApiSurfaceTest`](../src/test/java/com/ankurm/resilience/ApiSurfaceTest.java)):
|
|
|
|
| Attribute | Default |
|
|
|---|---|
|
|
| `maxRetries` | `3` - retries *after* the first call |
|
|
| `delay` | `1000` (ms) |
|
|
| `multiplier` | `1.0` - no growth |
|
|
| `maxDelay` | `Long.MAX_VALUE` |
|
|
| `jitter` | `0` |
|
|
| `timeout` | `0` - no budget |
|
|
| `timeUnit` | `MILLISECONDS` |
|
|
| `includes` / `excludes` | empty - every exception is retryable |
|
|
|
|
`@ConcurrencyLimit` has no usable default limit (`Integer.MIN_VALUE` means "not set") and
|
|
`policy = BLOCK`. `@EnableResilientMethods` has `proxyTargetClass = false` and
|
|
`order = Integer.MAX_VALUE - 1`.
|
|
|
|
## It moved during 7.0.x
|
|
|
|
[`api-surface.txt`](output/api-surface.txt), per release:
|
|
|
|
| Added in | What |
|
|
|---|---|
|
|
| 7.0.0 | `@Retryable` (no `timeout`), `@ConcurrencyLimit` (no `policy`), `RetryTemplate`, `RetryPolicy` |
|
|
| 7.0.2 | `@Retryable.timeout`/`timeoutString`, `RetryPolicy.Builder.timeout(..)`, `RetryListener.onRetryPolicyTimeout` and `onRetryableExecution` |
|
|
| 7.0.3 | `@ConcurrencyLimit.policy` with `ThrottlePolicy.BLOCK` / `REJECT` |
|
|
|
|
Release dates from the Maven Central `Last-Modified` headers: 7.0.0 on 13 Nov 2025, 7.0.2 on
|
|
11 Dec 2025, 7.0.3 on 15 Jan 2026. Articles written against the 7.0 GA - including the Spring reference page at the time
|
|
this was written, which does not mention `timeout` or `policy` - describe a smaller API than the
|
|
one you have.
|