#[non_exhaustive]pub enum DeadLetterReason {
UnknownPid {
pid: u32,
context: AuditContext,
},
UnknownConversation {
conversation_id: String,
context: AuditContext,
},
VersionMismatch {
expected: String,
received: String,
context: AuditContext,
},
DuplicateMessage {
inbox_key: String,
context: AuditContext,
},
ProcessingError {
message: String,
context: AuditContext,
},
OutboxExhausted {
message_id: OutboxMessageId,
message_type: String,
recipient: String,
last_error: String,
attempts: u32,
},
}Expand description
Structured reason why an inbound message was rejected.
The variant gives the dispatch path enough information to emit an
actionable CONTRL or log entry. Each variant carries an AuditContext
with the §22 MessZV fields required for regulatory audit logging.
Adding new variants is a non-breaking change thanks to #[non_exhaustive].
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnknownPid
No workflow is registered for this PID in the PidRouter.
The PID is either from a future BDEW release not yet deployed or a malformed message. Respond with a CONTRL negative acknowledgement.
Fields
context: AuditContext§22 MessZV structured audit context.
UnknownConversation
No in-flight process matched the inbound conversation_id.
This typically means the process completed, was never started, or
the ProcessRegistry was lost on restart (see.
Fields
context: AuditContext§22 MessZV structured audit context.
VersionMismatch
The message’s format version has no registered MessageAdapter.
Either the adapter registry is incomplete (see or the sender is using a deprecated / future format version.
Fields
context: AuditContext§22 MessZV structured audit context.
DuplicateMessage
A message with this inbox key was already accepted (AS4 duplicate).
The AS4 sender retries for up to 72 hours. The InboxStore
detected the duplicate and the message must not be processed again.
Fields
context: AuditContext§22 MessZV structured audit context.
ProcessingError
A workflow or adapter returned a processing error.
The message was routed correctly but could not be processed. Use this variant when the failure is definitive (not retriable).
Fields
context: AuditContext§22 MessZV structured audit context.
OutboxExhausted
The outbox delivery worker gave up after exhausting all retry attempts.
The message was re-queued max_attempts times and never successfully
delivered to the AS4 endpoint (or ERP webhook). The message is removed
from the outbox and recorded here for regulatory audit.
Fields
message_id: OutboxMessageIdThe outbox message ID of the undeliverable message.
Implementations§
Source§impl DeadLetterReason
impl DeadLetterReason
Sourcepub fn label(&self) -> &'static str
pub fn label(&self) -> &'static str
Short label identifying the rejection category.
Suitable for structured log fields and metric labels.
Sourcepub fn audit_context(&self) -> Option<&AuditContext>
pub fn audit_context(&self) -> Option<&AuditContext>
Return the AuditContext embedded in this reason, if present.
OutboxExhausted does not carry an AuditContext because it refers
to an outbound message (not an inbound AS4 message).
Trait Implementations§
Source§impl Clone for DeadLetterReason
impl Clone for DeadLetterReason
Source§fn clone(&self) -> DeadLetterReason
fn clone(&self) -> DeadLetterReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more