Package com.rale4j.sb.annotation
Annotation Interface Rale4j
Custom annotation to enforce rate limiting on methods.
Example usage:
@Rale4j(strategy = "guava", limit = 10, duration = 60)
public String myMethod() {
return "Rate-limited method";
}
-
Optional Element Summary
Optional Elements
-
Element Details
-
strategy
String strategyThe rate-limiting strategy to use (e.g., "guava", "redis").- Returns:
- the strategy name
- Default:
"guava"
-
limit
int limitThe maximum number of requests allowed within the duration.- Returns:
- the request limit
- Default:
10
-
duration
int durationThe time window (in seconds) for the rate limit.- Returns:
- the duration in seconds
- Default:
60
-