Transactional outbox — Phase 1: domain_event log + transactional publish#94
Open
luksow wants to merge 4 commits into
Open
Transactional outbox — Phase 1: domain_event log + transactional publish#94luksow wants to merge 4 commits into
luksow wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Producer-side infrastructure for a transactional outbox (Phase 1 of 2; delivery/consumers come in Phase 2).
What's here
V6__domain_event.sql— append-onlydomain_eventlog (plain table;(event_type, id)and(aggregate_type, aggregate_id)indexes).DomainEventenvelope + opaqueDomainEventId(UUIDv7).OutboxRepository—append: DBInTransaction[Unit](events written only inside a transaction) andfindByAggregate(audit read).DomainEventDescriptor[A]typeclass (versionedevent_type, aggregate identity, jsonb encoding).DomainEvents.publishTransactionally[A]— stamps a UUIDv7 id +occurred_atand appends in the caller's transaction.Not in scope (Phase 2)
Delivery ledger, dispatcher,
subscribe/consumers, scheduler dead-letter, backfill, DI wiring, and the account-deletion worked example.Tests
Testcontainers + Flyway: jsonb round-trip, publish writes the versioned event with a UUIDv7 id, and atomicity (a failing surrounding transaction persists no event).