Interface RetryPolicy.Outcome

Enclosing interface:
RetryPolicy

public static sealed interface RetryPolicy.Outcome
The outcome of applying a RetryPolicy to a given message. The outcome can either be to reschedule or to not reschedule.
  • Method Summary

    Modifier and Type
    Method
    Description
    Factory method to create an Outcome that requests the retry to not be rescheduled.
    rescheduleIn(long interval, TimeUnit timeUnit)
    Factory method to create an Outcome that requests the retry to be scheduled at the given interval (using given timeUnit).
    long
    The amount of time to wait before rescheduling the message.
    The unit in which the interval is expressed
    boolean
    Indicates whether this Outcome indicates rescheduling the dispatch of a message.
  • Method Details

    • rescheduleIn

      static RetryPolicy.Outcome rescheduleIn(long interval, TimeUnit timeUnit)
      Factory method to create an Outcome that requests the retry to be scheduled at the given interval (using given timeUnit).
      Parameters:
      interval - The amount of time to wait before rescheduling the message
      timeUnit - The unit of time in which interval is expressed
      Returns:
      an Outcome representing a request to reschedule
    • doNotReschedule

      static RetryPolicy.Outcome doNotReschedule()
      Factory method to create an Outcome that requests the retry to not be rescheduled. Any failure will be relayed to the caller.
      Returns:
      an Outcome that requests the retry to not be rescheduled
    • shouldReschedule

      boolean shouldReschedule()
      Indicates whether this Outcome indicates rescheduling the dispatch of a message.
      Returns:
      true if the message should be rescheduled, otherwise false
    • rescheduleInterval

      long rescheduleInterval()
      The amount of time to wait before rescheduling the message. Should be ignored when shouldReschedule() returns false.
      Returns:
      amount of time to wait before rescheduling the message
    • rescheduleIntervalTimeUnit

      TimeUnit rescheduleIntervalTimeUnit()
      The unit in which the interval is expressed
      Returns:
      the unit in which the interval is expressed