Expand description
Transactional outbox primitives shared by every storage and transport adapter in the workspace.
The crate is split into two sides:
- Producer —
OutboxServicepersists new events into the outbox table, applying the configuredIdempotencyStrategyand optionally reserving the token through an externalIdempotencyStorageProvider. - Worker —
OutboxManager, constructed viaOutboxManagerBuilder, drives the processing loop: it waits for notifications, fetches pending rows, publishes each through aTransport, and runs a background garbage collector on the side.
Storage and transport backends live in sibling crates (outbox-postgres,
outbox-redis, outbox-kafka). This crate only defines the traits they
must satisfy.
§Features
sqlx— derivessqlx::Type/sqlx::FromRowon the domain types so storage adapters can map rows without manual conversion.dlq— enables the dead-letter-queue heap (seeDlqHeap); the worker then tracks per-event failure counts on every publish attempt.metrics— emitsoutbox.events_totalandoutbox.publish_duration_secondsvia themetricscrate.full— turns onsqlx,dlq, andmetricstogether.
§Getting started
Import the common types via the prelude module:
ⓘ
use outbox_core::prelude::*;Modules§
- prelude
- Curated set of re-exports for typical integrator code.