Class CommonRateLimiterConfigurationProperties.InstanceProperties
java.lang.Object
io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties
- Enclosing class:
- CommonRateLimiterConfigurationProperties
Class storing property values for configuring
RateLimiterConfig instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the shared configuration name.Configures the permissions limit for refresh period.Configures the period of limit refresh.Configures the default wait for permission duration.Returns if we should enable writable stack traces or not.setAllowHealthIndicatorToFail(Boolean allowHealthIndicatorToFail) When set to true, it allows the health indicator to go to a failed (DOWN) status.setBaseConfig(String baseConfig) Sets the shared configuration name.setEventConsumerBufferSize(Integer eventConsumerBufferSize) setLimitForPeriod(Integer limitForPeriod) Configures the permissions limit for refresh period.setLimitRefreshPeriod(Duration limitRefreshPeriod) Configures the period of limit refresh.setRegisterHealthIndicator(Boolean registerHealthIndicator) setSubscribeForEvents(Boolean subscribeForEvents) setTimeoutDuration(Duration timeout) Configures the default wait for permission duration.setWritableStackTraceEnabled(Boolean writableStackTraceEnabled) Sets if we should enable writable stack traces or not.
-
Constructor Details
-
InstanceProperties
public InstanceProperties()
-
-
Method Details
-
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 CommonRateLimiterConfigurationProperties.InstanceProperties setLimitForPeriod(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
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 CommonRateLimiterConfigurationProperties.InstanceProperties setLimitRefreshPeriod(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
Configures the default wait for permission duration. Default value is 5 seconds.- Returns:
- wait for permission duration
-
setTimeoutDuration
public CommonRateLimiterConfigurationProperties.InstanceProperties setTimeoutDuration(Duration timeout) Configures the default wait for permission duration. Default value is 5 seconds.- Parameters:
timeout- wait for permission duration
-
getWritableStackTraceEnabled
Returns if we should enable writable stack traces or not.- Returns:
- writableStackTraceEnabled if we should enable writable stack traces or not.
-
setWritableStackTraceEnabled
public CommonRateLimiterConfigurationProperties.InstanceProperties setWritableStackTraceEnabled(Boolean writableStackTraceEnabled) Sets if we should enable writable stack traces or not.- Parameters:
writableStackTraceEnabled- The flag to enable writable stack traces.
-
getSubscribeForEvents
-
setSubscribeForEvents
public CommonRateLimiterConfigurationProperties.InstanceProperties setSubscribeForEvents(Boolean subscribeForEvents) -
getEventConsumerBufferSize
-
setEventConsumerBufferSize
public CommonRateLimiterConfigurationProperties.InstanceProperties setEventConsumerBufferSize(Integer eventConsumerBufferSize) -
getAllowHealthIndicatorToFail
- Returns:
- the flag that controls if health indicators are allowed to go into a failed (DOWN) status.
- See Also:
-
setAllowHealthIndicatorToFail
public CommonRateLimiterConfigurationProperties.InstanceProperties setAllowHealthIndicatorToFail(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
-
setRegisterHealthIndicator
public CommonRateLimiterConfigurationProperties.InstanceProperties setRegisterHealthIndicator(Boolean registerHealthIndicator) -
getBaseConfig
Gets the shared configuration name. If this is set, the configuration builder will use the shared configuration instance over this one.- Returns:
- The shared configuration name.
-
setBaseConfig
Sets the shared configuration name. If this is set, the configuration builder will use the shared configuration instance over this one.- Parameters:
baseConfig- The shared configuration name.
-