Package io.smallrye.faulttolerance.api
Class RateLimitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceException
io.smallrye.faulttolerance.api.RateLimitException
- All Implemented Interfaces:
Serializable
public class RateLimitException
extends org.eclipse.microprofile.faulttolerance.exceptions.FaultToleranceException
The exception thrown when an invocation exceeds the configured rate limit.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRateLimitException(long retryAfterMillis) RateLimitException(long retryAfterMillis, String message) RateLimitException(long retryAfterMillis, String message, Throwable t) RateLimitException(long retryAfterMillis, Throwable t) RateLimitException(String message) RateLimitException(String message, Throwable t) -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the number of milliseconds after which the user may retry the rejected invocation.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
RateLimitException
public RateLimitException() -
RateLimitException
public RateLimitException(long retryAfterMillis) -
RateLimitException
-
RateLimitException
-
RateLimitException
-
RateLimitException
-
RateLimitException
-
RateLimitException
-
-
Method Details
-
getRetryAfterMillis
public long getRetryAfterMillis()Returns the number of milliseconds after which the user may retry the rejected invocation. Retrying sooner is guaranteed to be rejected again. Note that this information is accurate only at the time the invocation is rejected. It may be invalidated by any subsequent or concurrent invocations, so there is no guarantee that a retry attempt after the given number of milliseconds will in fact be permitted.Returns a negative number when the information is not known.
- Returns:
- the minimum number of milliseconds after which retrying makes sense
-