Class Decisions

java.lang.Object
org.axonframework.messaging.deadletter.Decisions

public abstract class Decisions extends Object
Utility class providing a number of reasonable EnqueueDecisions. Can, for example, be used by an EnqueuePolicy to return a decision.

Note that the EnqueueDecisions are only used for deciding if to enqueue or requeue a letter, and nothing more.

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

    • ignore

      public static <M extends Message> Ignore<M> ignore()
      Construct an Ignore defining that a dead letter should remain in the queue.

      Note that the result is only used to define the letter should remain in the queue, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Returns:
      An Ignore defining that a dead letter should remain in the queue.
    • doNotEnqueue

      public static <M extends Message> DoNotEnqueue<M> doNotEnqueue()
      Construct a DoNotEnqueue defining that a dead letter should not be enqueued at all.

      Note that the result is only used to define the letter should not be enqueued, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Returns:
      A DoNotEnqueue defining that a dead letter should not be enqueued at all.
    • evict

      public static <M extends Message> DoNotEnqueue<M> evict()
      Construct a DoNotEnqueue defining that a dead letter should be evicted from the queue.

      Note that the result is only used to define the letter should be evicted from the queue, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Returns:
      A DoNotEnqueue defining that a dead letter should be evicted from the queue.
    • enqueue

      public static <M extends Message> ShouldEnqueue<M> enqueue()
      Construct a ShouldEnqueue defining that a dead letter should be enqueued.

      Note that the result is only used to define the letter should be enqueued, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Returns:
      A ShouldEnqueue defining that a dead letter should be enqueued.
    • enqueue

      public static <M extends Message> ShouldEnqueue<M> enqueue(Throwable enqueueCause)
      Construct a ShouldEnqueue defining that a dead letter should be enqueued because of the given enqueueCause.

      Note that the result is only used to define the letter should be enqueued with the given enqueueCause, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Parameters:
      enqueueCause - The reason for enqueueing a dead letter.
      Returns:
      A ShouldEnqueue defining that a dead letter should be enqueued because of the given enqueueCause.
    • enqueue

      public static <M extends Message> ShouldEnqueue<M> enqueue(Throwable enqueueCause, Function<DeadLetter<? extends M>,Metadata> diagnosticsBuilder)
      Construct a ShouldEnqueue defining that a dead letter should be enqueued because of the given enqueueCause. The diagnosticsBuilder constructs diagnostic Metadata to append to the letter to enqueue.

      Note that the result is only used to define the letter should be enqueued with the given enqueueCause and diagnostics, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Parameters:
      enqueueCause - The reason for enqueueing a dead letter.
      diagnosticsBuilder - A builder of diagnostic Metadata.
      Returns:
      A ShouldEnqueue defining that a dead letter should be enqueued because of the given enqueueCause.
    • requeue

      public static <M extends Message> ShouldEnqueue<M> requeue(Throwable requeueCause)
      Construct a ShouldEnqueue defining that a dead letter should be requeued because of the given requeueCause.

      Note that the result is only used to define the letter should be requeued with the given requeueCause, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Parameters:
      requeueCause - The reason for requeueing a dead letter.
      Returns:
      A ShouldEnqueue defining that a dead letter should be requeued because of the given requeueCause.
    • requeue

      public static <M extends Message> ShouldEnqueue<M> requeue(Throwable requeueCause, Function<DeadLetter<? extends M>,Metadata> diagnosticsBuilder)
      Construct a ShouldEnqueue defining that a dead letter should be requeued because of the given requeueCause. The diagnosticsBuilder constructs diagnostic Metadata to append to the letter to requeue.

      Note that the result is only used to define the letter should be requeued with the given requeueCause and diagnostics, and nothing more.

      Type Parameters:
      M - The type of message contained in the DeadLetter that's been made a decision on.
      Parameters:
      requeueCause - The reason for requeueing a dead letter.
      diagnosticsBuilder - A builder of diagnostic Metadata.
      Returns:
      A ShouldEnqueue defining that a dead letter should be requeued because of the given requeueCause.