Class GenericDeadLetter<M extends Message>

java.lang.Object
io.axoniq.framework.messaging.deadletter.GenericDeadLetter<M>
Type Parameters:
M - the message type
All Implemented Interfaces:
DeadLetter<M>

public class GenericDeadLetter<M extends Message> extends Object implements DeadLetter<M>
Generic implementation of the dead letter allowing any type of Message to be dead lettered.
Since:
4.6.0
Author:
Steven van Beelen, Mitchell Herrijgers
  • Field Details

  • Constructor Details

    • GenericDeadLetter

      public GenericDeadLetter(Object sequenceIdentifier, M message)
      Construct a GenericDeadLetter with the given sequenceIdentifier and message. The cause() is left empty in this case. This method is typically used to construct a dead letter that's part of a sequence.
      Parameters:
      sequenceIdentifier - the sequence identifier of the GenericDeadLetter to build
      message - the Message of type M of the GenericDeadLetter to build
    • GenericDeadLetter

      public GenericDeadLetter(Object sequenceIdentifier, M message, @Nullable Throwable cause)
      Construct a GenericDeadLetter with the given sequenceIdentifier, message, and cause. This method is typically used to construct the first dead letter entry for the given queueIdentifier.
      Parameters:
      sequenceIdentifier - the sequence identifier of the GenericDeadLetter to build
      message - the Message of type M of the GenericDeadLetter to build
      cause - the cause for the message to be dead lettered
    • GenericDeadLetter

      public GenericDeadLetter(Object sequenceIdentifier, M message, @Nullable Throwable cause, Context context)
      Construct a GenericDeadLetter with the given sequenceIdentifier, message, cause, and associated Context.
      Parameters:
      sequenceIdentifier - the sequence identifier of the GenericDeadLetter to build
      message - the Message of type M of the GenericDeadLetter to build
      cause - the cause for the message to be dead lettered
      context - the Context associated with this dead letter
    • GenericDeadLetter

      public GenericDeadLetter(Object sequenceIdentifier, M message, @Nullable Cause cause, Instant enqueuedAt, Instant lastTouched, Metadata diagnostics)
      Construct a GenericDeadLetter defining all the fields. The Context defaults to Context.empty().
      Parameters:
      sequenceIdentifier - the sequence identifier of the GenericDeadLetter to build
      message - the Message of type M of the GenericDeadLetter to build
      cause - the cause for the message to be dead lettered
      enqueuedAt - the moment this dead letter is enqueued
      lastTouched - the last time this dead letter was touched
      diagnostics - the diagnostic Metadata of this dead letter
    • GenericDeadLetter

      public GenericDeadLetter(Object sequenceIdentifier, M message, @Nullable Cause cause, Instant enqueuedAt, Instant lastTouched, Metadata diagnostics, Context context)
      Construct a GenericDeadLetter defining all the fields including the associated Context.
      Parameters:
      sequenceIdentifier - the sequence identifier of the GenericDeadLetter to build
      message - the Message of type M of the GenericDeadLetter to build
      cause - the cause for the message to be dead lettered
      enqueuedAt - the moment this dead letter is enqueued
      lastTouched - the last time this dead letter was touched
      diagnostics - the diagnostic Metadata of this dead letter
      context - the Context associated with this dead letter
  • Method Details