public static class RateLimiterConfig.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
Builder(RateLimiterConfig prototype) |
| Modifier and Type | Method and Description |
|---|---|
RateLimiterConfig |
build()
Builds a RateLimiterConfig
|
RateLimiterConfig.Builder |
limitForPeriod(int limitForPeriod)
Configures the permissions limit for refresh period.
|
RateLimiterConfig.Builder |
limitRefreshPeriod(java.time.Duration limitRefreshPeriod)
Configures the period of limit refresh.
|
RateLimiterConfig.Builder |
timeoutDuration(java.time.Duration timeoutDuration)
Configures the default wait for permission duration.
|
RateLimiterConfig.Builder |
writableStackTraceEnabled(boolean writableStackTraceEnabled)
Enables writable stack traces.
|
public Builder()
public Builder(RateLimiterConfig prototype)
public RateLimiterConfig build()
public RateLimiterConfig.Builder writableStackTraceEnabled(boolean writableStackTraceEnabled)
Throwable.getStackTrace()
returns a zero length array. This may be used to reduce log spam when the circuit breaker
is open as the cause of the exceptions is already known (the circuit breaker is
short-circuiting calls).writableStackTraceEnabled - flag to control if stack trace is writablepublic RateLimiterConfig.Builder timeoutDuration(java.time.Duration timeoutDuration)
timeoutDuration - the default wait for permission durationpublic RateLimiterConfig.Builder limitRefreshPeriod(java.time.Duration limitRefreshPeriod)
RateLimiterConfig.limitForPeriod value. Default value is 500
nanoseconds.limitRefreshPeriod - the period of limit refreshpublic RateLimiterConfig.Builder limitForPeriod(int limitForPeriod)
RateLimiterConfig.limitRefreshPeriod
value. Default value is 50.limitForPeriod - the permissions limit for refresh period