Skip to main content

DeadLetterReason

Enum DeadLetterReason 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

§pid: u32

The numeric Prüfidentifikator that had no registered workflow.

§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

§conversation_id: String

The conversation_id from the inbound EDIFACT interchange.

§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

§expected: String

The format version string the adapter registry expected.

§received: String

The format version string carried in the inbound message.

§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

§inbox_key: String

The inbox deduplication key (typically the AS4 MessageId).

§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

§message: String

Short, human-readable description of the failure.

§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: OutboxMessageId

The outbox message ID of the undeliverable message.

§message_type: String

The message type (e.g. "APERAK", "CONTRL").

§recipient: String

The intended recipient GLN.

§last_error: String

The last error returned by the AS4 sender.

§attempts: u32

How many delivery attempts were made.

Implementations§

Source§

impl DeadLetterReason

Source

pub fn label(&self) -> &'static str

Short label identifying the rejection category.

Suitable for structured log fields and metric labels.

Source

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

Source§

fn clone(&self) -> DeadLetterReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeadLetterReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for DeadLetterReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more