Class AbstractLocalRateLimiter

java.lang.Object
org.awsutils.sqs.config.AbstractLocalRateLimiter
All Implemented Interfaces:
org.awsutils.common.ratelimiter.RateLimiter, org.awsutils.common.ratelimiter.RateLimiterReload
Direct Known Subclasses:
LocalRateLimiter

public abstract class AbstractLocalRateLimiter extends Object implements org.awsutils.common.ratelimiter.RateLimiter, org.awsutils.common.ratelimiter.RateLimiterReload
  • Constructor Details

    • AbstractLocalRateLimiter

      public AbstractLocalRateLimiter(String rateLimiterKey, String rateLimiterTimeUnitKey, org.springframework.core.env.Environment environment)
  • Method Details

    • hasExceededMaxRate

      public boolean hasExceededMaxRate()
      Specified by:
      hasExceededMaxRate in interface org.awsutils.common.ratelimiter.RateLimiter
    • getMaxRate

      public int getMaxRate()
      Specified by:
      getMaxRate in interface org.awsutils.common.ratelimiter.RateLimiter
    • getRateLimiterName

      public String getRateLimiterName()
      Specified by:
      getRateLimiterName in interface org.awsutils.common.ratelimiter.RateLimiter
    • init

      @PostConstruct public AbstractLocalRateLimiter init()
    • refreshIfRateChanged

      public void refreshIfRateChanged()
      Checks the instance level rate value against the value in FF4J and reloads the RateLimiter instance if they are different.
      Specified by:
      refreshIfRateChanged in interface org.awsutils.common.ratelimiter.RateLimiterReload