outbox-pattern

Persist domain events atomically with aggregates using EF Core, Quartz, and MediatR.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/hiiamsky/multi-agent-dev-team --skill outbox-pattern-hiiamsky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: outbox-pattern
Source: https://github.com/hiiamsky/multi-agent-dev-team/tree/main/.github/skills/dotnet-outbox-pattern
Command: npx skills add https://github.com/hiiamsky/multi-agent-dev-team --skill outbox-pattern-hiiamsky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures reliable domain event delivery by persisting events in the same transaction as aggregates, guaranteeing durability even after crashes or restarts.

Core Features & Use Cases

  • Atomic persistence of domain events with aggregates in a single unit of work.
  • Asynchronous processing with retry, and idempotent handlers to prevent duplicates.
  • End-to-end workflow for publishing domain events across microservices with reliable delivery.

Quick Start

Trigger domain events during a save, then rely on the outbox processor to publish them.

Frequently Asked Questions about outbox-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ensure reliable domain event delivery with EF Core if my application crashes?

The outbox pattern solves this by persisting domain events in the same database transaction as aggregates. This guarantees atomic persistence, ensuring no events are lost even if the application crashes or restarts before asynchronous processing begins.

How do I handle duplicate domain events when publishing asynchronously across microservices?

Duplicate domain events are handled using idempotent handlers. This prevents duplicate processing when asynchronous retries occur, ensuring reliable delivery without side effects across microservice boundaries.

Can I use MediatR and Quartz for batch processing and retrying domain events?

Yes, MediatR and Quartz can be configured to process outbox messages asynchronously. This enables batch processing, retries with backoff strategies, and cleanup of old outbox messages to maintain reliable domain event delivery.

What is the best way to trigger and publish domain events transactionally?

The best way is to trigger domain events during an aggregate save operation within a single transaction. An outbox processor then asynchronously publishes these atomically persisted events, ensuring end-to-end reliable delivery.

Does transactional outbox processing support cleanup of old domain event messages?

Yes, transactional outbox processing includes cleanup of old outbox messages. This prevents database bloat while maintaining atomic persistence and reliable delivery of domain events across microservices.