outbox/ — events between the planes¶
The transactional outbox: events committed with the change they announce, relayed in order to Redis Streams, and handled once per consumer.
The transactional outbox (M8). A change and the event announcing it commit together, or neither does; then a relay moves events onto Redis Streams, at least once, in order.
emit(type, data, subject)validatesdataagainstschemas/events/<type>.v<N>.jsonand inserts anOutboxEvent— and refuses to run outside a transaction, because an event that could commit without its change (or the reverse) defeats the outbox. Every HTTP request is atomic (ATOMIC_REQUESTS), so an admin publish and the event its signal emits share one transaction; commands and tasks that write wrap their work intransaction.atomic().- The relay (
relay_pending, therelay_outboxcommand, the beat task) publishes undelivered rows oldest first and marks them. A transport failure stops the batch at that event, records the attempt, and retries next pass, so order holds. On Postgres rows are claimed withSKIP LOCKED. - Consumers (
consumers.py, theconsume_eventscommand, which loads every app'sconsumersmodule) read a stream through a consumer group.handle_envelopevalidates the envelope and its data, then records(event id, consumer)inProcessedEventin the same transaction as the handler's writes — a redelivered event is handled once.
| Stream | Written by | Read by |
|---|---|---|
zer0:content |
this plane | this plane's outbox desk (outboxdesk.consumers, group outboxdesk) and its own consumers (distribution.consumers; automations.consumers, the automations an event fires), through consume_events --own --group platform (the compose events service) |
zer0:app |
nothing since the Rails app was deleted (ADR 0008); the site renderer is its next publisher | this plane (graph.consumers) |
Event types and their schemas: schemas/events/README.md. A CloudEvents envelope carries the run's trace id as traceparent, so a trace started in either plane can be followed into the other.