M
- An implementation of Message
contained in the dead letter
that's been made a
decision on.public interface EnqueueDecision<M extends Message<?>>
dead letter
containing a message of type
M
concerning whether to add it to a SequencedDeadLetterQueue
.
Describes that the letter should be enqueued
or not. If the letter should be enqueued the
enqueueCause()
may contain a Throwable
. Furthermore, withDiagnostics(DeadLetter)
may add
diagnostic
information to the dead letter that should be taken into account when
enqueueing the letter.
If shouldEnqueue()
returns false
, that means the dead letter will not be inserted in the queue to
begin with, or it will be evicted
from the dead-letter queue.
Decisions
Modifier and Type | Method and Description |
---|---|
Optional<Throwable> |
enqueueCause()
|
boolean |
shouldEnqueue()
The decision whether the
dead letter should be enqueued in a queue. |
default DeadLetter<? extends M> |
withDiagnostics(DeadLetter<? extends M> letter)
|
boolean shouldEnqueue()
dead letter
should be enqueued in a queue. When false
the
dead letter should be evicted.true
if the dead letter
should be enqueued, false
if the dead letter
should be evicted.Optional<Throwable> enqueueCause()
Throwable
Optional
that was part of deciding to enqueue the dead letter
in a
queue. Empty if the dead letter
should be evicted or when there is no failure cause used for deciding to
enqueue.dead letter
, when present.default DeadLetter<? extends M> withDiagnostics(DeadLetter<? extends M> letter)
DeadLetter.diagnostics()
MetaData
to the given letter
.
The added diagnostics may provide additional information on the decision that may be used to influence future
decisions.
By default, the letter
is returned as is.
letter
- The dead letter
to add diagnostic
MetaData
to.letter
when diagnostic
MetaData
was added.Copyright © 2010–2024. All rights reserved.