Class RetryConfig

java.lang.Object
io.confluent.telemetry.config.remote.polling.RetryConfig

public final class RetryConfig extends Object
Configuration for retry behavior with exponential backoff. This class is immutable and thread-safe.
  • Method Details

    • from

      public static RetryConfig from(PollingRemoteConfigurationConfig config)
      Creates a RetryConfig from PollingRemoteConfigurationConfig.
    • noRetries

      public static RetryConfig noRetries()
      Creates a RetryConfig that results in no retries.
    • getMaxAttempts

      public int getMaxAttempts()
      Returns:
      the maximum number of retry attempts (0 disables retries)
    • isRetryEnabled

      public boolean isRetryEnabled()
      Returns:
      true if retries are enabled (maxAttempts > 0)
    • calculateDelay

      public long calculateDelay(int attemptNumber)
      Calculates the delay for a specific retry attempt using exponential backoff.
      Parameters:
      attemptNumber - the attempt number (1-based, where 1 is the first retry)
      Returns:
      the delay in milliseconds, capped at maxDelayMs
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object