Class RateLimiterConfigurationProperties.InstanceProperties
java.lang.Object
io.github.resilience4j.common.ratelimiter.configuration.RateLimiterConfigurationProperties.InstanceProperties
- Enclosing class:
- RateLimiterConfigurationProperties
public static class RateLimiterConfigurationProperties.InstanceProperties
extends java.lang.Object
Class storing property values for configuring
RateLimiterConfig instances.-
Constructor Summary
Constructors Constructor Description InstanceProperties() -
Method Summary
Modifier and Type Method Description java.lang.BooleangetAllowHealthIndicatorToFail()java.lang.StringgetBaseConfig()Gets the shared configuration name.java.lang.IntegergetEventConsumerBufferSize()java.lang.IntegergetLimitForPeriod()Configures the permissions limit for refresh period.java.time.DurationgetLimitRefreshPeriod()Configures the period of limit refresh.java.lang.BooleangetRegisterHealthIndicator()java.lang.BooleangetSubscribeForEvents()java.time.DurationgetTimeoutDuration()Configures the default wait for permission duration.java.lang.BooleangetWritableStackTraceEnabled()Returns if we should enable writable stack traces or not.RateLimiterConfigurationProperties.InstancePropertiessetAllowHealthIndicatorToFail(java.lang.Boolean allowHealthIndicatorToFail)When set to true, it allows the health indicator to go to a failed (DOWN) status.RateLimiterConfigurationProperties.InstancePropertiessetBaseConfig(java.lang.String baseConfig)Sets the shared configuration name.RateLimiterConfigurationProperties.InstancePropertiessetEventConsumerBufferSize(java.lang.Integer eventConsumerBufferSize)RateLimiterConfigurationProperties.InstancePropertiessetLimitForPeriod(java.lang.Integer limitForPeriod)Configures the permissions limit for refresh period.RateLimiterConfigurationProperties.InstancePropertiessetLimitRefreshPeriod(java.time.Duration limitRefreshPeriod)Configures the period of limit refresh.RateLimiterConfigurationProperties.InstancePropertiessetRegisterHealthIndicator(java.lang.Boolean registerHealthIndicator)RateLimiterConfigurationProperties.InstancePropertiessetSubscribeForEvents(java.lang.Boolean subscribeForEvents)RateLimiterConfigurationProperties.InstancePropertiessetTimeoutDuration(java.time.Duration timeout)Configures the default wait for permission duration.RateLimiterConfigurationProperties.InstancePropertiessetWritableStackTraceEnabled(java.lang.Boolean writableStackTraceEnabled)Sets if we should enable writable stack traces or not.
-
Constructor Details
-
InstanceProperties
public InstanceProperties()
-
-
Method Details
-
getLimitForPeriod
@Nullable public java.lang.Integer getLimitForPeriod()Configures the permissions limit for refresh period. Count of permissions available during one rate limiter period specified byRateLimiterConfig.getLimitRefreshPeriod()value. Default value is 50.- Returns:
- the permissions limit for refresh period
-
setLimitForPeriod
public RateLimiterConfigurationProperties.InstanceProperties setLimitForPeriod(java.lang.Integer limitForPeriod)Configures the permissions limit for refresh period. Count of permissions available during one rate limiter period specified byRateLimiterConfig.getLimitRefreshPeriod()value. Default value is 50.- Parameters:
limitForPeriod- the permissions limit for refresh period
-
getLimitRefreshPeriod
@Nullable public java.time.Duration getLimitRefreshPeriod()Configures the period of limit refresh. After each period rate limiter sets its permissions count toRateLimiterConfig.getLimitForPeriod()value. Default value is 500 nanoseconds.- Returns:
- the period of limit refresh
-
setLimitRefreshPeriod
public RateLimiterConfigurationProperties.InstanceProperties setLimitRefreshPeriod(java.time.Duration limitRefreshPeriod)Configures the period of limit refresh. After each period rate limiter sets its permissions count toRateLimiterConfig.getLimitForPeriod()value. Default value is 500 nanoseconds.- Parameters:
limitRefreshPeriod- the period of limit refresh
-
getTimeoutDuration
@Nullable public java.time.Duration getTimeoutDuration()Configures the default wait for permission duration. Default value is 5 seconds.- Returns:
- wait for permission duration
-
setTimeoutDuration
public RateLimiterConfigurationProperties.InstanceProperties setTimeoutDuration(java.time.Duration timeout)Configures the default wait for permission duration. Default value is 5 seconds.- Parameters:
timeout- wait for permission duration
-
getWritableStackTraceEnabled
public java.lang.Boolean getWritableStackTraceEnabled()Returns if we should enable writable stack traces or not.- Returns:
- writableStackTraceEnabled if we should enable writable stack traces or not.
-
setWritableStackTraceEnabled
public RateLimiterConfigurationProperties.InstanceProperties setWritableStackTraceEnabled(java.lang.Boolean writableStackTraceEnabled)Sets if we should enable writable stack traces or not.- Parameters:
writableStackTraceEnabled- The flag to enable writable stack traces.
-
getSubscribeForEvents
public java.lang.Boolean getSubscribeForEvents() -
setSubscribeForEvents
public RateLimiterConfigurationProperties.InstanceProperties setSubscribeForEvents(java.lang.Boolean subscribeForEvents) -
getEventConsumerBufferSize
public java.lang.Integer getEventConsumerBufferSize() -
setEventConsumerBufferSize
public RateLimiterConfigurationProperties.InstanceProperties setEventConsumerBufferSize(java.lang.Integer eventConsumerBufferSize) -
getAllowHealthIndicatorToFail
@Nullable public java.lang.Boolean getAllowHealthIndicatorToFail()- Returns:
- the flag that controls if health indicators are allowed to go into a failed (DOWN) status.
- See Also:
setAllowHealthIndicatorToFail(Boolean)
-
setAllowHealthIndicatorToFail
public RateLimiterConfigurationProperties.InstanceProperties setAllowHealthIndicatorToFail(java.lang.Boolean allowHealthIndicatorToFail)When set to true, it allows the health indicator to go to a failed (DOWN) status. By default, health indicators for rate limiters will never go into an unhealthy state.- Parameters:
allowHealthIndicatorToFail- flag to control if the health indicator is allowed to fail- Returns:
- the InstanceProperties
-
getRegisterHealthIndicator
public java.lang.Boolean getRegisterHealthIndicator() -
setRegisterHealthIndicator
public RateLimiterConfigurationProperties.InstanceProperties setRegisterHealthIndicator(java.lang.Boolean registerHealthIndicator) -
getBaseConfig
@Nullable public java.lang.String getBaseConfig()Gets the shared configuration name. If this is set, the configuration builder will use the the shared configuration instance over this one.- Returns:
- The shared configuration name.
-
setBaseConfig
public RateLimiterConfigurationProperties.InstanceProperties setBaseConfig(java.lang.String baseConfig)Sets the shared configuration name. If this is set, the configuration builder will use the the shared configuration instance over this one.- Parameters:
baseConfig- The shared configuration name.
-