Class FixedDelayRetryPolicy

  • All Implemented Interfaces:
    io.namastack.outbox.retry.OutboxRetryPolicy

    
    public final class FixedDelayRetryPolicy
     implements OutboxRetryPolicy
                        

    Retry policy that uses a fixed delay between retry attempts.

    This policy always waits the same amount of time between retries, regardless of the retry count or exception type.

    Since:

    0.1.0

    Author:

    Roland Beisel

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Boolean shouldRetry(Throwable exception) Always returns true, indicating that retries should be attempted.
      Duration nextDelay(Integer retryCount) Returns the fixed delay duration for all retry attempts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedDelayRetryPolicy

        FixedDelayRetryPolicy(Duration delay)
        Parameters:
        delay - Fixed delay duration between retries
    • Method Detail

      • shouldRetry

         Boolean shouldRetry(Throwable exception)

        Always returns true, indicating that retries should be attempted.

        Parameters:
        exception - The exception that occurred
        Returns:

        Always true

      • nextDelay

         Duration nextDelay(Integer retryCount)

        Returns the fixed delay duration for all retry attempts.

        Parameters:
        retryCount - The current retry count (ignored)
        Returns:

        The fixed delay duration