final class QueuedMessage (View source)

Carries a message together with immutable transport metadata for one delivery attempt.

Database transports may retain the authenticated raw envelope so failed-job diagnostics preserve exactly what was reserved without serializing the hydrated object again.

Methods

__construct(object $message, string $queue = 'default', int|null $id = null, int $attempts = 0, string|null $rawPayload = null, QueueReservationReceipt|null $reservationReceipt = null)

Captures a message and its transport-owned delivery metadata.

object

Returns the hydrated object delivered to its registered handler.

object
string
queue()

Returns the logical queue from which this delivery originated.

string
int|null
id()

Returns the persistent transport identifier, or null for an in-memory delivery.

int|null
int

Returns the one-based delivery attempt recorded by the transport.

int
string|null

Returns the original authenticated database envelope when the transport retained one.

string|null

Returns the opaque ownership fence attached by a persistent lease transport.

withAttempts(int $attempts)

Creates a metadata copy for another attempt without changing the message or raw envelope.

Details

__construct

__construct(object $message, string $queue = 'default', int|null $id = null, int $attempts = 0, string|null $rawPayload = null, QueueReservationReceipt|null $reservationReceipt = null)

Captures a message and its transport-owned delivery metadata.

Parameters

object $message
string $queue
int|null $id
int $attempts
string|null $rawPayload
QueueReservationReceipt|null $reservationReceipt

message

object message()

Returns the hydrated object delivered to its registered handler.

Return Value

object

queue

string queue()

Returns the logical queue from which this delivery originated.

Return Value

string

id

int|null id()

Returns the persistent transport identifier, or null for an in-memory delivery.

Return Value

int|null

attempts

int attempts()

Returns the one-based delivery attempt recorded by the transport.

Return Value

int

rawPayload

string|null rawPayload()

Returns the original authenticated database envelope when the transport retained one.

Return Value

string|null

reservationReceipt

QueueReservationReceipt|null reservationReceipt()
internal  Applications must not log or persist the receipt in a message payload.
 

Returns the opaque ownership fence attached by a persistent lease transport.

Return Value

QueueReservationReceipt|null

withAttempts

QueuedMessage withAttempts(int $attempts)

Creates a metadata copy for another attempt without changing the message or raw envelope.

Parameters

int $attempts

Return Value

QueuedMessage