Record Class MessageEnvelope
java.lang.Object
java.lang.Record
org.j7m.middleware.api.messaging.MessageEnvelope
- Record Components:
queue- source queuepartitionId- queue partitionmessageId- durable message idmessage- message payload and headerstate- current message statepriority- message priorityenqueueSequence- enqueue sequenceretryCount- retry count
- All Implemented Interfaces:
Serializable
public record MessageEnvelope(QueueName queue, QueuePartitionId partitionId, MessageId messageId, QueueMessage message, MessageState state, MessagePriority priority, long enqueueSequence, int retryCount)
extends Record
implements Serializable
Message plus durable delivery metadata.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageEnvelope(QueueName queue, QueuePartitionId partitionId, MessageId messageId, QueueMessage message, MessageState state, MessagePriority priority, long enqueueSequence, int retryCount) Creates a message envelope. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theenqueueSequencerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.Returns the value of themessageIdrecord component.Returns the value of thepartitionIdrecord component.priority()Returns the value of thepriorityrecord component.queue()Returns the value of thequeuerecord component.intReturns the value of theretryCountrecord component.state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageEnvelope
public MessageEnvelope(QueueName queue, QueuePartitionId partitionId, MessageId messageId, QueueMessage message, MessageState state, MessagePriority priority, long enqueueSequence, int retryCount) Creates a message envelope.- Throws:
IllegalArgumentException- when required values are null or counters are negative
-
-
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. -
queue
-
partitionId
Returns the value of thepartitionIdrecord component.- Returns:
- the value of the
partitionIdrecord component
-
messageId
-
message
-
state
-
priority
-
enqueueSequence
public long enqueueSequence()Returns the value of theenqueueSequencerecord component.- Returns:
- the value of the
enqueueSequencerecord component
-
retryCount
public int retryCount()Returns the value of theretryCountrecord component.- Returns:
- the value of the
retryCountrecord component
-