Annotation Interface ConcurrencyLimit
In the type-level case, all methods inheriting the concurrency limit from the type level share a common concurrency throttle, with any mix of such method invocations contributing to the shared concurrency limit. Whereas for a locally annotated method, a local throttle with the specified limit is going to be applied to invocations of that particular method only.
This is particularly useful with Virtual Threads where there is generally
no thread pool limit in place. For asynchronous tasks, this can be constrained
on SimpleAsyncTaskExecutor
; for
synchronous invocations, this annotation provides equivalent behavior through
ConcurrencyThrottleInterceptor
.
- Since:
- 7.0
- Author:
- Juergen Hoeller
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionint
The applicable concurrency limit: 1 by default, effectively locking the target instance for each method invocation.
-
Element Details
-
value
int valueThe applicable concurrency limit: 1 by default, effectively locking the target instance for each method invocation.Specify a limit higher than 1 for pool-like throttling, constraining the number of concurrent invocations similar to the upper bound of a pool.
- Default:
1
-