Annotation Interface RateLimiter
This annotation can be applied to a class or a specific method. Applying it on a class is
equivalent to applying it on all its public methods. The annotation enables throttling for all
methods where it is applied. Throttling monitoring is performed via a rate limiter. See
RateLimiter for details. If using Spring,
name and fallbackMethod can be resolved using Spring Expression Language (SpEL).-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionfallbackMethod method name.intNumber of permits that this call requires.
-
Element Details
-
name
String nameName of the rate limiter It can be SpEL expression. If you want to use the first parameter of the method as name, you can express it as#root.args[0],#p0or#a0. The method name can be accessed via#root.methodName. To invoke a method on a Spring bean, pass@yourBean.yourMethod(#a0).- Returns:
- the name of the limiter
-
-
-
fallbackMethod
String fallbackMethodfallbackMethod method name.- Returns:
- fallbackMethod method name.
- Default:
- ""
-
permits
int permitsNumber of permits that this call requires.- Returns:
- the number of permits that this call requires.
- Default:
- 1
-