Record Class EnqueueOptions

java.lang.Object
java.lang.Record
org.j7m.middleware.api.messaging.EnqueueOptions
Record Components:
priority - message priority, where larger values lease first
partitionId - explicit target partition, or null for key/hash routing
orderingKey - optional ordering/routing key
idempotencyKey - optional explicit idempotency key
dedupeKey - optional explicit duplicate-detection key
notBefore - earliest delivery time
All Implemented Interfaces:
Serializable

public record EnqueueOptions(MessagePriority priority, QueuePartitionId partitionId, OrderingKey orderingKey, IdempotencyKey idempotencyKey, DedupeKey dedupeKey, Instant notBefore) extends Record implements Serializable
Options controlling durable queue enqueue behavior.

The record is immutable, serializable, and thread-safe. Phase 6.3 durable queue and outbox recovery preserve these options where they affect message delivery: priority, explicit partition, ordering key, idempotency key, dedupe key, and not-before delivery time. These options do not imply broker-wide ordering, distributed balancing, or generic exactly-once delivery.

See Also:
  • Constructor Details

  • Method Details

    • defaults

      public static EnqueueOptions defaults()
      Returns default enqueue options.
      Returns:
      default options
    • explicitPartition

      public Optional<QueuePartitionId> explicitPartition()
      Returns the optional explicit partition id.
      Returns:
      explicit partition when present
    • 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.
    • priority

      public MessagePriority priority()
      Returns the value of the priority record component.
      Returns:
      the value of the priority record component
    • partitionId

      public QueuePartitionId partitionId()
      Returns the value of the partitionId record component.
      Returns:
      the value of the partitionId record component
    • orderingKey

      public OrderingKey orderingKey()
      Returns the value of the orderingKey record component.
      Returns:
      the value of the orderingKey record component
    • idempotencyKey

      public IdempotencyKey idempotencyKey()
      Returns the value of the idempotencyKey record component.
      Returns:
      the value of the idempotencyKey record component
    • dedupeKey

      public DedupeKey dedupeKey()
      Returns the value of the dedupeKey record component.
      Returns:
      the value of the dedupeKey record component
    • notBefore

      public Instant notBefore()
      Returns the value of the notBefore record component.
      Returns:
      the value of the notBefore record component