Class RqueueMessage

java.lang.Object
com.github.sonus21.rqueue.models.SerializableBase
com.github.sonus21.rqueue.core.RqueueMessage
All Implemented Interfaces:
Serializable

public class RqueueMessage extends SerializableBase
Envelope for a message being processed through Rqueue. Each message maintains its own state including serialized content, retry metadata, failure counts, and timing information.

Message Content. The message field holds the serialized (JSON) representation of the user's object. Use RqueueMessageUtils to convert between serialized and object form.

Timing and Scheduling. queuedTime records when the message was enqueued (nanosecond precision). processAt defines the intended processing time (for delayed messages). reEnqueuedAt tracks the last re-queue timestamp following failure.

Failure Tracking. failureCount and sourceQueueFailureCount track retries in the current and source queue respectively. Once retries are exhausted, the message may be routed to the configured dead-letter queue (sourceQueueName).

Periodic Tasks. For messages representing recurring work, the period field (in milliseconds) defines the recurrence interval. Use nextProcessAt() to compute the next scheduling time.

See Also:
  • Constructor Details

    • RqueueMessage

      public RqueueMessage()
  • Method Details

    • updateReEnqueuedAt

      public RqueueMessage updateReEnqueuedAt()
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • nextProcessAt

      public long nextProcessAt()
    • isPeriodic

      public boolean isPeriodic()