pub struct DeadLetterMessage {
pub original_id: String,
pub original_payload: Value,
pub source_queue: String,
pub attempt_count: u32,
pub error_message: String,
pub dlq_timestamp: DateTime<Utc>,
pub last_worker_id: Option<String>,
pub failure_context: Value,
}Expand description
Represents a message that has been sent to the Dead Letter Queue. Contains the original message payload along with failure context.
Fields§
§original_id: StringOriginal message ID
original_payload: ValueOriginal message payload
source_queue: StringQueue where the message originated
attempt_count: u32Number of processing attempts before DLQ
error_message: StringError that caused the final failure
dlq_timestamp: DateTime<Utc>Timestamp when message was sent to DLQ
last_worker_id: Option<String>Worker ID that processed the message last
failure_context: ValueAdditional metadata about the failure
Implementations§
Source§impl DeadLetterMessage
impl DeadLetterMessage
Sourcepub fn new(
original_id: String,
original_payload: Value,
source_queue: String,
attempt_count: u32,
error_message: String,
) -> Self
pub fn new( original_id: String, original_payload: Value, source_queue: String, attempt_count: u32, error_message: String, ) -> Self
Create a new dead letter message from processing context.
Sourcepub fn with_worker_id(self, worker_id: String) -> Self
pub fn with_worker_id(self, worker_id: String) -> Self
Set the worker ID that last processed this message.
Sourcepub fn with_context(self, key: &str, value: Value) -> Self
pub fn with_context(self, key: &str, value: Value) -> Self
Add additional failure context metadata.
Trait Implementations§
Source§impl Clone for DeadLetterMessage
impl Clone for DeadLetterMessage
Source§fn clone(&self) -> DeadLetterMessage
fn clone(&self) -> DeadLetterMessage
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeadLetterMessage
impl Debug for DeadLetterMessage
Source§impl<'de> Deserialize<'de> for DeadLetterMessage
impl<'de> Deserialize<'de> for DeadLetterMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeadLetterMessage
impl RefUnwindSafe for DeadLetterMessage
impl Send for DeadLetterMessage
impl Sync for DeadLetterMessage
impl Unpin for DeadLetterMessage
impl UnsafeUnpin for DeadLetterMessage
impl UnwindSafe for DeadLetterMessage
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
Mutably borrows from an owned value. Read more