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.FaultToleranceExceptionThe exception thrown when an invocation exceeds the configured rate limit.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RateLimitException()RateLimitException(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)RateLimitException(Throwable t)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetRetryAfterMillis()Returns 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 Detail
-
RateLimitException
public RateLimitException()
-
RateLimitException
public RateLimitException(long retryAfterMillis)
-
RateLimitException
public RateLimitException(Throwable t)
-
RateLimitException
public RateLimitException(long retryAfterMillis, Throwable t)
-
RateLimitException
public RateLimitException(String message)
-
RateLimitException
public RateLimitException(long retryAfterMillis, String message)
-
-
Method Detail
-
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
-
-