Class RateLimiterException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.teceli.resiliencia.core.api.ResilientException
io.github.teceli.resiliencia.patterns.ratelimiter.RateLimiterException
- All Implemented Interfaces:
Serializable
Thrown when a RateLimiter rejects a call because the current window's permits are used up
and no permit would become available within the configured maximum wait time.
The name carried by this exception is the rate limiter's own name, which must be a
static, compile-time-known string — never request-derived or tenant-derived. It is used as a
cardinality-bounded key/tag in metrics and logging; unbounded distinct names would cause
unbounded memory growth in metrics backends.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimiterException(String name, int limit, Duration period, Duration maxWait) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RateLimiterException
-
-
Method Details
-
name
The rate limiter instance name. -
limit
public int limit()The number of calls permitted per window. -
period
The window length. -
maxWait
How long the call was allowed to wait for a permit before being rejected (zero means fail-fast).
-