feat: add transaction outbox primitives for reliable event delivery - #147
Open
ReinaMaze wants to merge 1 commit into
Open
feat: add transaction outbox primitives for reliable event delivery#147ReinaMaze wants to merge 1 commit into
ReinaMaze wants to merge 1 commit into
Conversation
- Add OutboxEvent and JobAttempt models with stable IDs and typed statuses - Implement OutboxService for writing domain changes and events atomically - Implement JobLeaseService with lease-based concurrency control - Add exponential backoff, retry logic, and dead-lettering - Implement idempotent completion and abandoned lease recovery - Add EventSchemaRegistry for event payload versioning and validation - Support RolledBackRecord markers for handling domain transaction rollbacks - Add comprehensive unit tests for types and schema registry - Update tsconfig.json to ES2023 for Error.cause support - Add migration to create outbox_events, job_attempts, and rolled_back_records tables This foundation enables reliable delivery of work across PostgreSQL, job queues, and external systems (blockchain, notifications, webhooks) with guaranteed: - No lost events on server crash - No duplicate side effects from retries - Automatic recovery from abandoned work - Graceful degradation with dead-letter handling
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.
close #122
Title:
Add Transaction Outbox and Job Delivery Foundation
Description:
This PR implements the transactional outbox pattern to enable reliable event delivery across PostgreSQL, asynchronous job queues, and external systems (blockchain, notifications, webhooks).
Problem Solved:
What's Included:
Database Schema:
Core Services:
Key Features:
Testing:
Documentation:
Technical Details:
Acceptance Criteria Met:
Dependencies:
Related Issues: