pub struct DeadLetterRecord {Show 14 fields
pub queue: String,
pub job_id: String,
pub job_type: String,
pub payload: Option<Payload>,
pub priority: Priority,
pub max_attempts: u32,
pub custom: HashMap<String, Primitive>,
pub trace_context: Option<TraceContext>,
pub enqueued_at: SystemTime,
pub scheduled_at: Option<SystemTime>,
pub cause: DeadLetterCause,
pub failed_at: SystemTime,
pub final_attempt: u32,
pub last_reason: Option<String>,
}Expand description
A dead-lettered job retained by the server, returned by
drain_dead_letters.
It is a snapshot for inspection and manual replay: read cause,
last_reason, and final_attempt
to see what went wrong, then call
to_enqueue_request to re-submit it.
Fields§
§queue: StringThe queue the job belonged to.
job_id: StringThe dead-lettered job’s server-assigned id.
job_type: StringThe producer’s job-type tag.
payload: Option<Payload>The job’s payload, if any.
priority: PriorityThe job’s effective priority.
max_attempts: u32The maximum delivery attempts the job died with (the producer’s override, or the queue default the server applied).
custom: HashMap<String, Primitive>Custom metadata the producer attached.
trace_context: Option<TraceContext>The producer’s trace context, if any and well-formed.
enqueued_at: SystemTimeWhen the producer originally enqueued the job.
scheduled_at: Option<SystemTime>When the producer scheduled the job to run, if it was delayed; None
for a job that was available immediately.
cause: DeadLetterCauseWhy the job was dead-lettered.
failed_at: SystemTimeWhen the job was dead-lettered.
final_attempt: u32The attempt the job died on (1-based).
last_reason: Option<String>The reason from the last nack, when the job died on a nack path; None
for a lease-expiry death.
Implementations§
Source§impl DeadLetterRecord
impl DeadLetterRecord
Sourcepub fn to_enqueue_request(&self) -> EnqueueRequest
pub fn to_enqueue_request(&self) -> EnqueueRequest
Builds an EnqueueRequest that replays this job into its original
queue, preserving its payload, priority, max attempts, custom metadata,
and trace context. The replay is a fresh job — the server assigns a new
id and resets the attempt counter — and it runs immediately: the
original scheduled_at is deliberately not copied, since it is in the
past by the time a job has died and been drained.
Equivalent to EnqueueRequest::from(&record); both leave the record
intact. To consume the record without cloning, use
EnqueueRequest::from(record) (or record.into()).
Trait Implementations§
Source§impl Clone for DeadLetterRecord
impl Clone for DeadLetterRecord
Source§fn clone(&self) -> DeadLetterRecord
fn clone(&self) -> DeadLetterRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeadLetterRecord
impl Debug for DeadLetterRecord
Source§impl From<&DeadLetterRecord> for EnqueueRequest
impl From<&DeadLetterRecord> for EnqueueRequest
Source§fn from(r: &DeadLetterRecord) -> Self
fn from(r: &DeadLetterRecord) -> Self
Replays a dead-lettered job into its original queue, leaving the record intact.
Source§impl From<DeadLetterRecord> for EnqueueRequest
impl From<DeadLetterRecord> for EnqueueRequest
Source§fn from(r: DeadLetterRecord) -> Self
fn from(r: DeadLetterRecord) -> Self
Replays a dead-lettered job into its original queue, consuming the record.
Auto Trait Implementations§
impl Freeze for DeadLetterRecord
impl RefUnwindSafe for DeadLetterRecord
impl Send for DeadLetterRecord
impl Sync for DeadLetterRecord
impl Unpin for DeadLetterRecord
impl UnsafeUnpin for DeadLetterRecord
impl UnwindSafe for DeadLetterRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request