Class CommonRateLimiterConfigurationProperties.InstanceProperties

java.lang.Object
io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties
Enclosing class:
CommonRateLimiterConfigurationProperties

public static class CommonRateLimiterConfigurationProperties.InstanceProperties extends Object
Class storing property values for configuring RateLimiterConfig instances.
  • Constructor Details

    • InstanceProperties

      public InstanceProperties()
  • Method Details

    • getLimitForPeriod

      @Nullable public Integer getLimitForPeriod()
      Configures the permissions limit for refresh period. Count of permissions available during one rate limiter period specified by RateLimiterConfig.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 by RateLimiterConfig.getLimitRefreshPeriod() value. Default value is 50.
      Parameters:
      limitForPeriod - the permissions limit for refresh period
    • getLimitRefreshPeriod

      @Nullable public Duration getLimitRefreshPeriod()
      Configures the period of limit refresh. After each period rate limiter sets its permissions count to RateLimiterConfig.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 to RateLimiterConfig.getLimitForPeriod() value. Default value is 500 nanoseconds.
      Parameters:
      limitRefreshPeriod - the period of limit refresh
    • getTimeoutDuration

      @Nullable public Duration getTimeoutDuration()
      Configures the default wait for permission duration. Default value is 5 seconds.
      Returns:
      wait for permission duration
    • setTimeoutDuration

      Configures the default wait for permission duration. Default value is 5 seconds.
      Parameters:
      timeout - wait for permission duration
    • getWritableStackTraceEnabled

      public 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 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

      public Boolean getSubscribeForEvents()
    • setSubscribeForEvents

      public CommonRateLimiterConfigurationProperties.InstanceProperties setSubscribeForEvents(Boolean subscribeForEvents)
    • getEventConsumerBufferSize

      public Integer getEventConsumerBufferSize()
    • setEventConsumerBufferSize

      public CommonRateLimiterConfigurationProperties.InstanceProperties setEventConsumerBufferSize(Integer eventConsumerBufferSize)
    • getAllowHealthIndicatorToFail

      @Nullable public Boolean 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

      public Boolean getRegisterHealthIndicator()
    • setRegisterHealthIndicator

      public CommonRateLimiterConfigurationProperties.InstanceProperties setRegisterHealthIndicator(Boolean registerHealthIndicator)
    • getBaseConfig

      @Nullable public String 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.