Record Class UnknownDeadlinePayload

java.lang.Object
java.lang.Record
org.axonframework.deadline.UnknownDeadlinePayload
Record Components:
typeName - the stored name of the payload type, which could not be resolved
revision - the stored revision of the payload type, if any
data - the stored payload, as a byte[] or a String, depending on the deadline manager

public record UnknownDeadlinePayload(String typeName, @Nullable String revision, @Nullable Object data) extends Record
The payload of a fired deadline whose stored payload type name could not be resolved to a class.

The persistent deadline managers (QuartzDeadlineManager, JobRunrDeadlineManager and DbSchedulerDeadlineManager) store a deadline's payload together with the name of its type. When a deadline fires on a node that lacks that type, for example because the payload class was renamed or moved while the deadline was pending, the deadline fires with this payload instead of failing, and the job completes. Axon Framework 4 did the same through its UnknownSerializedType.

A DeadlineHandler without a payload parameter receives it. A handler that declares another payload type does not. To read the content, convert the data() with the Converter the deadline manager was configured with:


 @DeadlineHandler(deadlineName = "paymentDue")
 public void on(DeadlineMessage deadline) {
     if (deadline.payload() instanceof UnknownDeadlinePayload unknown) {
         logger.warn("Deadline with payload type [{}] fired, but that type is unknown", unknown.typeName());
     }
 }
 
Since:
5.4.0
Author:
Jakob Hatzl
  • Constructor Details

    • UnknownDeadlinePayload

      public UnknownDeadlinePayload(String typeName, @Nullable String revision, @Nullable Object data)
      Creates an UnknownDeadlinePayload for the given stored typeName, revision and data.
      Parameters:
      typeName - the stored name of the payload type, which could not be resolved
      revision - the stored revision of the payload type, if any
      data - the stored payload, as a byte[] or a String, depending on the deadline manager
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • typeName

      public String typeName()
      Returns the value of the typeName record component.
      Returns:
      the value of the typeName record component
    • revision

      public @Nullable String revision()
      Returns the value of the revision record component.
      Returns:
      the value of the revision record component
    • data

      public @Nullable Object data()
      Returns the value of the data record component.
      Returns:
      the value of the data record component