Spring Framework 7.0 — Resilience Features
Scalability without control is just a different kind of risk.
Spring Framework 7.0 introduces out-of-the-box resilience features, making it easier to protect your application against overload and instability. These features are part of the spring-context module and can be enabled with: @EnableResilientMethods
Spring 7 brings two main resilience annotations:
@ConcurrencyLimit@Retryable
In this article, we’ll focus on @ConcurrencyLimit and why it becomes especially important in the era of Virtual Threads.
Why Concurrency Control Matters
With Virtual Threads, Java applications can handle a much higher number of concurrent requests. This is great for throughput and responsiveness, but it also introduces new risks:
Higher memory usage
Increased pressure on databases and external services
Risk of overwhelming downstream systems
Scaling without limits can easily turn into self-inflicted denial of service.
That’s exactly the problem @ConcurrencyLimit helps solve.
What @ConcurrencyLimit Does
The @ConcurrencyLimit annotation allows you to define how many concurrent executions a method can have.
When the limit is reached:
Additional calls are queued internally
No extra threads are created
The system remains stable and predictable
This is especially useful when enabling Virtual Threads but still needing to protect external dependencies.
Example Usage
@Async
@ConcurrencyLimit(100)
public CompletableFuture<List<Application>> findAll() {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
return CompletableFuture.completedFuture(
List.of(new Application(Thread.currentThread().getName()))
);
}
What’s happening here
The method can run at most 100 times in parallel
Extra calls wait in an internal queue
This prevents overload while still allowing high concurrency
This is a simple but powerful safety net when working with Virtual Threads.
You can access the code here: https://github.com/ThiagoBfim/spring-news
When Should You Use It?
@ConcurrencyLimit is a great choice when:
You’re adopting Virtual Threads
Your application depends on slower or fragile external systems
You want controlled scalability instead of unlimited parallelism
Conclusion
Spring Framework 7.0 makes resilience easier and more accessible.@ConcurrencyLimit gives you a simple way to scale safely, especially in modern, highly concurrent applications.
If you want to go deeper into Virtual Threads, I’ve written about them here:
If you enjoyed this content, subscribe for free and hit the like button.



