Skip to content

[Mocha] Require transaction for Postgres outbox publishes - #10555

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/outbox-require-transaction
Oct 19, 2026
Merged

tobias-tengler merged 1 commit into
mainfrom
tte/outbox-require-transaction

Conversation

@tobias-tengler

@tobias-tengler tobias-tengler commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Publishing or sending through the PostgreSQL outbox without an active transaction inserts the message immediately, independently of a later EF Core save. The message can therefore be dispatched even when the business changes fail or are never committed.

This PR requires a database or ambient transaction for outbox publishes and sends by default, while preserving runtime replies and faults and providing a named PostgresOutboxOptions.RequireTransaction opt-out for existing nontransactional callers.

@github-actions github-actions Bot added 📚 documentation This issue is about working on our documentation. 🌶️ mocha labels Oct 16, 2026
@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Patch coverage

100.0% of changed lines covered (21/21)

File Covered Changed Patch %
…/Outbox/OutboxServiceCollectionExtensions.cs 3 3 100.0% 🟢
…/Outbox/PostgresMessageOutbox.cs 17 17 100.0% 🟢
…/Outbox/PostgresOutboxOptions.cs 1 1 100.0% 🟢

Project coverage: 59.0% (311318/527659 lines)

@tobias-tengler
tobias-tengler force-pushed the tte/outbox-require-transaction branch from 8601620 to 7a44401 Compare October 16, 2026 11:21
@tobias-tengler
tobias-tengler force-pushed the tte/outbox-require-transaction branch from 7a44401 to 5dd6c4a Compare October 16, 2026 11:23
@tobias-tengler
tobias-tengler marked this pull request as ready for review October 16, 2026 11:23
Copilot AI balanced review requested due to automatic review settings October 16, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@tobias-tengler tobias-tengler changed the title [Mocha] Fix outbox publishes and sends outside a transaction [Mocha] Require transaction for Postgres outbox publishes Oct 19, 2026
@tobias-tengler
tobias-tengler merged commit bc4d068 into main Oct 19, 2026
163 checks passed
@tobias-tengler
tobias-tengler deleted the tte/outbox-require-transaction branch October 19, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📚 documentation This issue is about working on our documentation. 🌶️ mocha

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants