Menu

Retries Without Spring Retry: @Retryable and @ConcurrencyLimit in Spring Boot 4
📰

Retries Without Spring Retry: @Retryable and @ConcurrencyLimit in Spring Boot 4

DEV Community: java·Pushpak Raut·about 9 hours ago
#9tFOJnaS
#devtojava#devto#dev#spring#client
Long article (1632 words) — no AI summary yet.
Reading 0:00
15s threshold

For years, retrying a flaky call in Spring meant adding spring-retry and spring-boot-starter-aop, then putting @EnableRetry on a config class. Some teams went further and pulled in Resilience4j just to retry one HTTP call.

Spring Framework 7, which Spring Boot 4 is built on, has retries in its core. The annotation is still called @Retryable, but it lives in a new package, takes different attributes, and needs no extra dependency. Next to it sits @ConcurrencyLimit, which caps how many threads can run a method at the same time.

This post sets both up on a small service and proves each behavior with a test. All five tests pass on Spring Boot 4.1.2.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.