Skip to content

Add option for @ConcurrencyLimit to throw rejection exception #36109

@mafr

Description

@mafr

When using the @ConcurrencyLimit annotation added in 7.0, the underlying ConcurrencyThrottleInterceptor blocks (virtual) threads for a potentially very long time. In typical web scenarios, clients may no longer be interested in the result when the blocked methods finally execute, but they execute anyway, wasting resources.

As a user, I would expect this behavior to be documented in the @ConcurrencyLimit Javadoc (note that the way the Lock is used, there is no guarantee of fairness). Ideally, I would be able to specify a different behavior on the annotation (e.g. throw an exception that I can map to a 429 HTTP status code).

Thank you!

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: feedback-providedFeedback has been providedtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions