Skip to content
bitzorcas
EN

Concept

CAP Event Publish Sequence

Transactional outbox pattern with CAP dispatcher for reliable event publishing.

Last updated

Overview

The CAP event publish sequence diagram illustrates the transactional outbox pattern: domain events raised within an aggregate are written atomically alongside business data during IUnitOfWork.CommitAsync(). The CAP dispatcher then polls the outbox table and publishes to RabbitMQ, where subscribers consume messages with inbox-based idempotency.

Key takeaways

  • Atomic commit guarantees business data and outbox row are never out of sync
  • CAP Dispatcher runs as a background poller, decoupling publish from the request path
  • Inbox deduplication in consumers prevents duplicate side-effects from redelivered messages
  • Failed deliveries route to a dead letter queue with configurable retry backoff