Expand description
Inbox deduplication for inbound messages.
In AS4-based market communication, messages may be retransmitted by the sender (AS4 retry logic). Without deduplication, a retry would create a duplicate process or trigger a duplicate state transition.
The inbox assigns a stable idempotency key to each inbound message (typically the UNH message reference + sender GLN) and refuses to process the same key twice.
§Usage
ⓘ
use mako_engine::inbox::{InboxStore, InMemoryInboxStore, inbox_key};
let inbox = InMemoryInboxStore::new();
let key = inbox_key(&sender_party_id, &message_ref)?;;
if !inbox.accept(&key).await? {
return Ok(()); // duplicate — drop silently
}
// process the message ...Constants§
- MAX_
INBOX_ KEY_ LEN - Maximum byte length of the caller-supplied inbox deduplication key.
Traits§
- Inbox
Store - Async idempotency store for inbound messages.
Functions§
- inbox_
key - Build a canonical inbox key from an EDIFACT message reference and the sender GLN, returning an error if either component is empty.