Class DeadLetterEventEntry
java.lang.Object
org.axonframework.messaging.eventhandling.deadletter.jpa.DeadLetterEventEntry
Represents an
EventMessage when stored into the database. It contains all properties known in the framework
implementations. Tracking tokens and aggregate data (only if legacy Aggregate approach is used: aggregate identifier,
type, sequence number) are stored as Context resources.- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeadLetterEventEntry(String type, String identifier, String messageTimestamp, byte[] payload, byte[] metadata, String aggregateType, String aggregateIdentifier, Long aggregateSequenceNumber, String tokenType, byte[] token) Constructs a newDeadLetterEventEntryusing the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the aggregate identifier, if the event was published in an aggregate context (stored as context resource).Returns the aggregate sequence number, if the event was published in an aggregate context (stored as context resource).Returns the aggregate type, if the event was published in an aggregate context (stored as context resource).Returns the originalEventMessage.identifier().byte[]Returns the serialized metadata as a byte array.byte[]Returns the serialized payload as a byte array.Returns the originalEventMessage.timestamp().byte[]getToken()Returns the serialized tracking token as a byte array, if the event was being processed from an event stream.Returns the tracking token type name.getType()Returns the originaltypeof the dead-letter, based on theMessageType.toString()output.inthashCode()toString()
-
Constructor Details
-
DeadLetterEventEntry
protected DeadLetterEventEntry() -
DeadLetterEventEntry
public DeadLetterEventEntry(String type, String identifier, String messageTimestamp, byte[] payload, byte[] metadata, String aggregateType, String aggregateIdentifier, Long aggregateSequenceNumber, String tokenType, byte[] token) Constructs a newDeadLetterEventEntryusing the provided parameters. Parameters can be null if not relevant. For example, aggregate info (type, identifier, sequence number) is stored when the event was published in an aggregate context (stored as context resources), and tracking token is stored when processing from an event stream.- Parameters:
type- TheMessageTypeof the event as aString, based on the output ofMessageType.toString()(required).identifier- The identifier of the message (required).messageTimestamp- The timestamp of the message (required).payload- The serialized payload of the message.metadata- The serialized metadata of the message.aggregateType- The aggregate type of the message.aggregateIdentifier- The aggregate identifier of the message.aggregateSequenceNumber- The aggregate sequence number of the message.tokenType- The type of tracking token the message.token- The serialized tracking token.
-
-
Method Details
-
getType
Returns the originaltypeof the dead-letter, based on theMessageType.toString()output.- Returns:
- The event message type.
-
getIdentifier
Returns the originalEventMessage.identifier().- Returns:
- The event identifier.
-
getTimestamp
Returns the originalEventMessage.timestamp().- Returns:
- The event timestamp.
-
getPayload
public byte[] getPayload()Returns the serialized payload as a byte array.- Returns:
- The serialized payload bytes.
-
getMetadata
public byte[] getMetadata()Returns the serialized metadata as a byte array.- Returns:
- The serialized metadata bytes.
-
getAggregateType
Returns the aggregate type, if the event was published in an aggregate context (stored as context resource).- Returns:
- The aggregate type, or
nullif not available.
-
getAggregateIdentifier
Returns the aggregate identifier, if the event was published in an aggregate context (stored as context resource).- Returns:
- The aggregate identifier, or
nullif not available.
-
getAggregateSequenceNumber
Returns the aggregate sequence number, if the event was published in an aggregate context (stored as context resource).- Returns:
- The aggregate sequence number, or
nullif not available.
-
getToken
public byte[] getToken()Returns the serialized tracking token as a byte array, if the event was being processed from an event stream.- Returns:
- The serialized tracking token bytes, or
nullif not available.
-
getTokenType
Returns the tracking token type name.- Returns:
- The fully qualified class name of the tracking token type, or
nullif no token was stored.
-
equals
-
hashCode
public int hashCode() -
toString
-