Class DeadLetterEventEntry

java.lang.Object
org.axonframework.messaging.eventhandling.deadletter.jpa.DeadLetterEventEntry

@Embeddable public class DeadLetterEventEntry extends Object
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 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 new DeadLetterEventEntry using 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 - The MessageType of the event as a String, based on the output of MessageType.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

      public String getType()
      Returns the original type of the dead-letter, based on the MessageType.toString() output.
      Returns:
      The event message type.
    • getIdentifier

      public String getIdentifier()
      Returns the original EventMessage.identifier().
      Returns:
      The event identifier.
    • getTimestamp

      public String getTimestamp()
      Returns the original EventMessage.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

      public String getAggregateType()
      Returns the aggregate type, if the event was published in an aggregate context (stored as context resource).
      Returns:
      The aggregate type, or null if not available.
    • getAggregateIdentifier

      public String getAggregateIdentifier()
      Returns the aggregate identifier, if the event was published in an aggregate context (stored as context resource).
      Returns:
      The aggregate identifier, or null if not available.
    • getAggregateSequenceNumber

      public Long 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 null if 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 null if not available.
    • getTokenType

      public String getTokenType()
      Returns the tracking token type name.
      Returns:
      The fully qualified class name of the tracking token type, or null if no token was stored.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object