Interface RetryPolicy

All Superinterfaces:
DescribableComponent
All Known Implementing Classes:
ExponentialBackOffRetryPolicy, FilteringRetryPolicy, MaxAttemptsPolicy

public interface RetryPolicy extends DescribableComponent
Describes a policy for retrying failed messages. These could be commands, events, as well as queries where the dispatching, or -in the case of commands and queries- the handling returned a failure.
  • Method Details

    • defineFor

      RetryPolicy.Outcome defineFor(@Nonnull Message message, @Nonnull Throwable failure, @Nonnull List<Class<? extends Throwable>[]> previousFailures)
      Provides the outcome for the policy given the failed message that was dispatched and resulted in given failure. The previousFailures represent a summary of previous failures that have occurred in previous attemps to send this message.
      Parameters:
      message - The message that failed
      failure - The exception that occurred while dispatching
      previousFailures - a summary of all previous failures
      Returns:
      the outcome describing the expected rescheduling behavior