Class TokenBucketThrottlingStrategyBuilder<T extends Request>

java.lang.Object
com.linecorp.armeria.server.throttling.bucket4j.TokenBucketThrottlingStrategyBuilder<T>

@UnstableApi
public final class TokenBucketThrottlingStrategyBuilder<T extends Request>
extends Object
  • Method Details

    • name

      Optional name of the strategy. By default, it will be assigned with a predefined name.
    • minimumBackoff

      public TokenBucketThrottlingStrategyBuilder<T> minimumBackoff​(Duration minimumBackoff)
      Optional Duration that defines a minimum backoff period for throttled requests. By default, it will be set to 0 seconds.
    • headersScheme

      public TokenBucketThrottlingStrategyBuilder<T> headersScheme​(ThrottlingHeaders headersScheme, boolean sendQuota)
      Optional ThrottlingHeaders to define specific RateLimit Header Scheme for HTTP. By default, no specialized throttling headers will be used. The strategy will only use standard HTTP Retry-After header.
      Parameters:
      headersScheme - defines specific RateLimit Header Scheme for HTTP.
      sendQuota - indicates whether to use quota header for the scheme, like X-RateLimit-Limit.
    • headersScheme

      public TokenBucketThrottlingStrategyBuilder<T> headersScheme​(ThrottlingHeaders headersScheme)
      Optional ThrottlingHeaders to define specific RateLimit Header Scheme for HTTP. By default, no throttling headers will be used. The strategy will only use standard HTTP Retry-After header.
      Parameters:
      headersScheme - defines specific RateLimit Header Scheme for HTTP. By default, the quota header will not be used for the scheme.
    • build

      Returns a newly-created TokenBucketThrottlingStrategy based on the properties of this builder.