TaskHub.Shared

TaskHub.Shared.Persistence.Outbox

Core abstractions for the Outbox pattern to ensure reliable message delivery.

Contents

Summary


The Outbox pattern is used to ensure that a domain event is eventually published, even if the primary database transaction and the message broker are not part of a single distributed transaction.

Workflow

  1. Save: The domain event is saved as an “Outbox Message” in the same transaction as the domain entity.
  2. Retrieve: A background worker polls the Outbox table for unpublished messages.
  3. Publish: The worker publishes the message to the broker and marks it as processed in the Outbox.