Interface EnqueuePolicy<M extends Message>

Type Parameters:
M - An implementation of Message contained in the dead letter that will be decided on through this policy.
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface EnqueuePolicy<M extends Message>
A functional interface constructing an EnqueueDecision based on a dead letter and cause. Should be used by components that insert dead letters into and processes dead letters from a SequencedDeadLetterQueue.

Implementers of a policy can use Decisions to construct the basic types of EnqueueDecision.

Since:
4.6.0
Author:
Steven van Beelen
See Also:
  • Method Details

    • decide

      EnqueueDecision<M> decide(DeadLetter<? extends M> letter, Throwable cause)
      Constructs a EnqueueDecision based on the given letter and cause. This operation is typically invoked when handling a Message failed and a decision should be made what to do with it.

      Implementers of this operation can use Decisions to construct the basic types of EnqueueDecision.

      Parameters:
      letter - The dead letter implementation to make a decision on.
      cause - The Throwable causing the given letter to be decided on.
      Returns:
      The decision used to decide what to do with the given letter.