Class Decisions
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 Summary
Modifier and TypeMethodDescriptionstatic <M extends Message>
DoNotEnqueue<M> Construct aDoNotEnqueuedefining that adead lettershould not be enqueued at all.static <M extends Message>
ShouldEnqueue<M> enqueue()Construct aShouldEnqueuedefining that adead lettershould be enqueued.static <M extends Message>
ShouldEnqueue<M> Construct aShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause.static <M extends Message>
ShouldEnqueue<M> enqueue(Throwable enqueueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) Construct aShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause.static <M extends Message>
DoNotEnqueue<M> evict()Construct aDoNotEnqueuedefining that adead lettershould be evicted from the queue.ignore()Construct anIgnoredefining that adead lettershould remain in the queue.static <M extends Message>
ShouldEnqueue<M> Construct aShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause.static <M extends Message>
ShouldEnqueue<M> requeue(Throwable requeueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) Construct aShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause.
-
Method Details
-
ignore
Construct anIgnoredefining that adead lettershould 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 theDeadLetterthat's been made a decision on.- Returns:
- An
Ignoredefining that adead lettershould remain in the queue.
-
doNotEnqueue
Construct aDoNotEnqueuedefining that adead lettershould 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 theDeadLetterthat's been made a decision on.- Returns:
- A
DoNotEnqueuedefining that adead lettershould not be enqueued at all.
-
evict
Construct aDoNotEnqueuedefining that adead lettershould 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 theDeadLetterthat's been made a decision on.- Returns:
- A
DoNotEnqueuedefining that adead lettershould be evicted from the queue.
-
enqueue
Construct aShouldEnqueuedefining that adead lettershould 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 theDeadLetterthat's been made a decision on.- Returns:
- A
ShouldEnqueuedefining that adead lettershould be enqueued.
-
enqueue
Construct aShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause.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 theDeadLetterthat's been made a decision on.- Parameters:
enqueueCause- The reason for enqueueing adead letter.- Returns:
- A
ShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause.
-
enqueue
public static <M extends Message> ShouldEnqueue<M> enqueue(Throwable enqueueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) Construct aShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause. ThediagnosticsBuilderconstructsdiagnosticMetadatato append to the letter to enqueue.Note that the result is only used to define the letter should be enqueued with the given
enqueueCauseand diagnostics, and nothing more.- Type Parameters:
M- The type of message contained in theDeadLetterthat's been made a decision on.- Parameters:
enqueueCause- The reason for enqueueing adead letter.diagnosticsBuilder- A builder ofdiagnosticMetadata.- Returns:
- A
ShouldEnqueuedefining that adead lettershould be enqueued because of the givenenqueueCause.
-
requeue
Construct aShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause.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 theDeadLetterthat's been made a decision on.- Parameters:
requeueCause- The reason for requeueing adead letter.- Returns:
- A
ShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause.
-
requeue
public static <M extends Message> ShouldEnqueue<M> requeue(Throwable requeueCause, Function<DeadLetter<? extends M>, Metadata> diagnosticsBuilder) Construct aShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause. ThediagnosticsBuilderconstructsdiagnosticMetadatato append to the letter to requeue.Note that the result is only used to define the letter should be requeued with the given
requeueCauseand diagnostics, and nothing more.- Type Parameters:
M- The type of message contained in theDeadLetterthat's been made a decision on.- Parameters:
requeueCause- The reason for requeueing adead letter.diagnosticsBuilder- A builder ofdiagnosticMetadata.- Returns:
- A
ShouldEnqueuedefining that adead lettershould be requeued because of the givenrequeueCause.
-