Class RateLimiterConfigurationProperties.InstanceProperties

  • Enclosing class:
    RateLimiterConfigurationProperties

    public static class RateLimiterConfigurationProperties.InstanceProperties
    extends java.lang.Object
    Class storing property values for configuring RateLimiterConfig instances.
    • Constructor Detail

      • InstanceProperties

        public InstanceProperties()
    • Method Detail

      • getLimitForPeriod

        @Nullable
        public java.lang.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 RateLimiterConfigurationProperties.InstanceProperties setLimitForPeriod​(java.lang.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 java.time.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 RateLimiterConfigurationProperties.InstanceProperties setLimitRefreshPeriod​(java.time.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 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()
      • getEventConsumerBufferSize

        public java.lang.Integer getEventConsumerBufferSize()
      • 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()
      • 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.