M - The type of Message represented by this interface.public interface DeadLetter<M extends Message<?>>
Message implementation of generic type M.
The time of storing the message() is kept through enqueuedAt(). The last time this letter was
accessed on either SequencedDeadLetterQueue.requeue(DeadLetter, UnaryOperator) or
processing, is kept in lastTouched(). Additional
information on why the letter is enqueued can be found in the diagnostics.
| Modifier and Type | Method and Description |
|---|---|
Optional<Cause> |
cause()
|
MetaData |
diagnostics()
The diagnostic
MetaData concerning this letter. |
Instant |
enqueuedAt()
The moment in time when the
message() was entered in a dead letter queue. |
Instant |
lastTouched()
The moment in time when this letter was last touched.
|
DeadLetter<M> |
markTouched()
Construct a copy of this
DeadLetter, replacing the lastTouched() with the current time. |
M |
message()
The
Message of type M contained in this letter. |
DeadLetter<M> |
withCause(Throwable requeueCause)
|
DeadLetter<M> |
withDiagnostics(MetaData diagnostics)
|
default DeadLetter<M> |
withDiagnostics(UnaryOperator<MetaData> diagnosticsBuilder)
Construct a copy of this
DeadLetter, replacing the diagnostics() with the result of
the given diagnosticsBuilder. |
M message()
Message of type M contained in this letter.Message of type M contained in this letter.Optional<Cause> cause()
cause for the message() to be dead lettered. Can be an Optional.empty() in
case this letter is enqueued without a causal error. For instance, when another letter already present in the
queue was blocking it being handled.Instant enqueuedAt()
message() was entered in a dead letter queue.message() was entered in a dead letter queue.Instant lastTouched()
enqueuedAt() value if this letter
is enqueued for the first time.MetaData diagnostics()
MetaData concerning this letter.MetaData concerning this letter.DeadLetter<M> markTouched()
DeadLetter, replacing the lastTouched() with the current time.DeadLetter with lastTouched() set to now.DeadLetter<M> withCause(Throwable requeueCause)
requeueCause - The new cause of the DeadLetter under construction.DeadLetter, replacing the cause() with the given requeueCause.DeadLetter<M> withDiagnostics(MetaData diagnostics)
diagnostics - The diagnostic MetaData to append to the DeadLetter under construction.DeadLetter, replacing the diagnostics() with the given
diagnostics.default DeadLetter<M> withDiagnostics(UnaryOperator<MetaData> diagnosticsBuilder)
DeadLetter, replacing the diagnostics() with the result of
the given diagnosticsBuilder. The diagnosticsBuilder will be invoked with the diagnostics of this
instance.diagnosticsBuilder - The lambda constructing diagnostic MetaData to replace
the MetaData of the DeadLetter under construction.DeadLetter, replacing the diagnostics() with the result of the
given diagnosticsBuilder.Copyright © 2010–2023. All rights reserved.