Expand description
The Postgres side of domain events (ADR-0018 § 4): the outbox the relay reads, the db
transport (event_deliveries) and the dead-letter sink every transport writes to. The tables
are migrations/outbox.sql, which puerto new --events writes into the project.
Structs§
- PgDead
Letters dead_letters, whatever the transport. Recording the same event for the same consumer twice keeps the first record (dead_letters_event_consumer).- PgDeliveries
- The relay’s publisher on the
dbtransport: fans each event out to the consumers subscribed to its type and marks it published, in one transaction. - PgOutbox
- The outbox, as the relay reads it.
- PgSubscription
- One consumer’s input on the
dbtransport.
Constants§
- DEFAULT_
CLAIM_ LEASE - How long a claimed delivery stays invisible to other claims. A worker that dies while handling one leaves it due again after this — at-least-once, never lost.
- RELAY_
LOCK_ KEY - The advisory lock the relay holds: only one worker replica relays, so the outbox order is
kept. The bytes of
"puerto".