Class PollingStrategies

java.lang.Object
software.amazon.lambda.durable.retry.PollingStrategies

public class PollingStrategies extends Object
Factory class for creating common polling strategies.
  • Constructor Details

    • PollingStrategies

      public PollingStrategies()
  • Method Details

    • exponentialBackoff

      public static PollingStrategy exponentialBackoff(Duration baseInterval, double backoffRate, JitterStrategy jitter, Duration maxInterval)
      Creates an exponential backoff polling strategy.

      The delay calculation follows the formula: delay = jitter(baseInterval × backoffRate^attempt)

      Parameters:
      baseInterval - Base delay before first poll
      backoffRate - Multiplier for exponential backoff (must be positive)
      jitter - Jitter strategy to apply to delays
      maxInterval - Maximum delay between polls
      Returns:
      PollingStrategy implementing exponential backoff with jitter
    • fixedDelay

      public static PollingStrategy fixedDelay(Duration interval)
      Creates a fixed-delay polling strategy that uses the same interval for every attempt.
      Parameters:
      interval - Fixed delay between polls
      Returns:
      PollingStrategy with fixed delay