Record Class OutboxEntry
java.lang.Object
java.lang.Record
org.j7m.middleware.api.messaging.OutboxEntry
- Record Components:
entryId- outbox entry idtargetQueue- target queuemessage- message to relayenqueueOptions- preserved enqueue optionsidempotencyKey- optional idempotency key copied for conveniencecreatedAt- creation timeattempts- relay attempt countpublished- whether the entry was durably marked publishedfailed- whether the entry exceeded relay attempts
- All Implemented Interfaces:
Serializable
public record OutboxEntry(MessageId entryId, QueueName targetQueue, QueueMessage message, EnqueueOptions enqueueOptions, IdempotencyKey idempotencyKey, Instant createdAt, int attempts, boolean published, boolean failed)
extends Record
implements Serializable
Durable outbound message intent.
The record is immutable, serializable, and thread-safe. The entry contains the message and enqueue options that must be preserved through outbox recovery and relay. Payload data is durable queue data and must not be used in status or exception text.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOutboxEntry(MessageId entryId, QueueName targetQueue, QueueMessage message, EnqueueOptions enqueueOptions, IdempotencyKey idempotencyKey, Instant createdAt, int attempts, boolean published, boolean failed) Creates an outbox entry. -
Method Summary
Modifier and TypeMethodDescriptionintattempts()Returns the value of theattemptsrecord component.Returns the value of thecreatedAtrecord component.Returns the value of theenqueueOptionsrecord component.entryId()Returns the value of theentryIdrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanfailed()Returns the value of thefailedrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theidempotencyKeyrecord component.message()Returns the value of themessagerecord component.booleanReturns the value of thepublishedrecord component.Returns the value of thetargetQueuerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OutboxEntry
public OutboxEntry(MessageId entryId, QueueName targetQueue, QueueMessage message, EnqueueOptions enqueueOptions, IdempotencyKey idempotencyKey, Instant createdAt, int attempts, boolean published, boolean failed) Creates an outbox entry.- Throws:
IllegalArgumentException- when required identity or message fields are absent
-
-
Method Details
-
toString
-
hashCode
-
equals
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
entryId
-
targetQueue
Returns the value of thetargetQueuerecord component.- Returns:
- the value of the
targetQueuerecord component
-
message
-
enqueueOptions
Returns the value of theenqueueOptionsrecord component.- Returns:
- the value of the
enqueueOptionsrecord component
-
idempotencyKey
Returns the value of theidempotencyKeyrecord component.- Returns:
- the value of the
idempotencyKeyrecord component
-
createdAt
-
attempts
-
published
-
failed
-