Class JpaDeadLetter<M extends EventMessage<?>>
java.lang.Object
org.axonframework.eventhandling.deadletter.jpa.JpaDeadLetter<M>
- Type Parameters:
M- TheEventMessagetype of the contained message.
- All Implemented Interfaces:
DeadLetter<M>
A
DeadLetter that was saved to the database and reconstructed from it. This object is immutable and should
only be changed using the withCause(Throwable), withDiagnostics(MetaData) and
markTouched() functions. These reconstruct a new object with the specified new properties.- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
ConstructorsConstructorDescriptionJpaDeadLetter(DeadLetterEntry entry, MetaData diagnostics, M message) Constructs a newJpaDeadLetterfrom aDeadLetterEntry, deserialized diagnostics and a reconstructed message. -
Method Summary
Modifier and TypeMethodDescriptioncause()Thecausefor theDeadLetter.message()to be dead lettered.The diagnosticMetaDataconcerning this letter.The moment in time when theDeadLetter.message()was entered in a dead letter queue.booleangetId()The ID of the entity in the database.getIndex()The index of the dead letter within its sequence identified by thesequenceIdentifier.The sequence identifier of thisDeadLetter.inthashCode()The moment in time when this letter was last touched.Construct a copy of thisDeadLetter, replacing theDeadLetter.lastTouched()with the current time.message()TheMessageof typeMcontained in this letter.toString()withDiagnostics(MetaData diagnostics) Construct a copy of thisDeadLetter, replacing theDeadLetter.diagnostics()with the givendiagnostics.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.messaging.deadletter.DeadLetter
withDiagnostics
-
Constructor Details
-
JpaDeadLetter
Constructs a newJpaDeadLetterfrom aDeadLetterEntry, deserialized diagnostics and a reconstructed message.- Parameters:
entry- TheDeadLetterEntryto construct this letter from.diagnostics- The deserialized diagnosticsMetaData.message- The reconstructedEventMessage.
-
-
Method Details
-
message
Description copied from interface:DeadLetterTheMessageof typeMcontained in this letter.- Specified by:
messagein interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- The
Messageof typeMcontained in this letter.
-
cause
Description copied from interface:DeadLetterThecausefor theDeadLetter.message()to be dead lettered. Can be anOptional.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.- Specified by:
causein interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- The
causefor theDeadLetter.message()to be dead lettered.
-
enqueuedAt
Description copied from interface:DeadLetterThe moment in time when theDeadLetter.message()was entered in a dead letter queue.- Specified by:
enqueuedAtin interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- The moment in time when the
DeadLetter.message()was entered in a dead letter queue.
-
lastTouched
Description copied from interface:DeadLetterThe moment in time when this letter was last touched. Will equal theDeadLetter.enqueuedAt()value if this letter is enqueued for the first time.- Specified by:
lastTouchedin interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- The moment in time when this letter was last touched.
-
diagnostics
Description copied from interface:DeadLetterThe diagnosticMetaDataconcerning this letter.- Specified by:
diagnosticsin interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- The diagnostic
MetaDataconcerning this letter.
-
getId
The ID of the entity in the database.- Returns:
- The ID of this
JpaDeadLetter.
-
getIndex
The index of the dead letter within its sequence identified by thesequenceIdentifier. Will ensure the events are kept in the original order.- Returns:
- The index of this
JpaDeadLetter.
-
getSequenceIdentifier
The sequence identifier of thisDeadLetter. If letters belong to the same sequence, they should be handled sequentially at all times. This is ensured by thegetIndex()property.- Returns:
- The sequence identifier of this
DeadLetter.
-
markTouched
Description copied from interface:DeadLetterConstruct a copy of thisDeadLetter, replacing theDeadLetter.lastTouched()with the current time.- Specified by:
markTouchedin interfaceDeadLetter<M extends EventMessage<?>>- Returns:
- A copy of this
DeadLetterwithDeadLetter.lastTouched()set to now.
-
withCause
Description copied from interface:DeadLetter- Specified by:
withCausein interfaceDeadLetter<M extends EventMessage<?>>- Parameters:
requeueCause- The new cause of theDeadLetterunder construction.- Returns:
- A copy of this
DeadLetter, replacing theDeadLetter.cause()with the givenrequeueCause.
-
withDiagnostics
Description copied from interface:DeadLetterConstruct a copy of thisDeadLetter, replacing theDeadLetter.diagnostics()with the givendiagnostics.- Specified by:
withDiagnosticsin interfaceDeadLetter<M extends EventMessage<?>>- Parameters:
diagnostics- The diagnosticMetaDatato append to theDeadLetterunder construction.- Returns:
- A copy of this
DeadLetter, replacing theDeadLetter.diagnostics()with the givendiagnostics.
-
toString
-
equals
-
hashCode
public int hashCode()
-