pub struct TrackedDelivery { /* private fields */ }Expand description
A delivery from RabbitMQ that automatically reports events on ack/nack/reject.
Reports job_completed on ack, job_retrying on nack/reject with requeue,
and job_failed on nack/reject without requeue.
When the metrics feature is enabled and counters are attached, also records
processing duration and success/failure for Tier 0 metrics collection.
Implementations§
Source§impl TrackedDelivery
impl TrackedDelivery
Sourcepub fn delivery_tag(&self) -> u64
pub fn delivery_tag(&self) -> u64
The delivery tag.
Sourcepub fn execution_id(&self) -> Uuid
pub fn execution_id(&self) -> Uuid
The execution ID assigned by the Queuerious server.
Sourcepub async fn ack(&self, options: BasicAckOptions) -> Result<(), Error>
pub async fn ack(&self, options: BasicAckOptions) -> Result<(), Error>
Acknowledge the delivery and report job_completed.
When the metrics feature is enabled, also records processing duration
and success to the shared counters.
Sourcepub async fn reject(
&self,
options: BasicRejectOptions,
error_message: &str,
) -> Result<(), Error>
pub async fn reject( &self, options: BasicRejectOptions, error_message: &str, ) -> Result<(), Error>
Reject the delivery and report a lifecycle event.
Reports job_retrying if requeue is true, job_failed otherwise.
When the metrics feature is enabled and requeue is false, records
a failure to the shared counters.
Sourcepub async fn nack(
&self,
options: BasicNackOptions,
error_message: &str,
) -> Result<(), Error>
pub async fn nack( &self, options: BasicNackOptions, error_message: &str, ) -> Result<(), Error>
Nack the delivery and report a lifecycle event.
Reports job_retrying if requeue is true, job_failed otherwise.
When the metrics feature is enabled and requeue is false, records
a failure to the shared counters.
Sourcepub fn report_retrying(&self, error_message: &str)
pub fn report_retrying(&self, error_message: &str)
Report a job_retrying event without acknowledging or rejecting the delivery.
Use this when your retry mechanism handles AMQP operations separately, such as the common “republish-to-retry-queue then ACK via raw channel” pattern.
Sourcepub fn report_dead_lettered(&self, error_message: &str)
pub fn report_dead_lettered(&self, error_message: &str)
Report a job_dead_lettered event without acknowledging or rejecting the delivery.
Use this when your dead-letter mechanism handles AMQP operations separately, such as NACKing via the raw channel after max retries are exceeded.