Skip to main content

Employee Outbox Storage

Summary​

EmployeeDbContext translates supported queued domain events into shared outbox records before EF Core saves changes. Business state, audit/timeline changes, and newly created outbox records participate in the same context commit.

Audience​

  • Backend developers and QA engineers
  • DevOps engineers and solution architects

Transaction boundary​

Persisted concepts​

The outbox object stores message and event identity, event type, serialized content, occurrence time, processing status, retry count, optional processing/error/correlation/tenant context, and source service. Exact payload bodies are intentionally excluded.

Index/constraintPurposeSource
Unique event-identity indexPrevent duplicate persisted event identifiersInfrastructure/EmployeeDbContext.cs
Status plus occurrence-time indexSupport ordered pending/failed retrievalsame

The outbox store selects Pending or Failed records ordered by occurrence time, and supports marking a record Processed or Failed. The outbox object is not covered by the end-user tenant query filters because its repository is an operational relay store.

Delivery boundary​

The unit of work proves atomic persistence of supported outbox records with the local Employee changes committed in that save. It does not prove that a relay is running, a broker accepted the message, or a downstream read model applied it. Runtime relay ownership and delivery guarantees remain Requires confirmation.

Source References​

  • microservices/src/employee-service/Infrastructure/EmployeeDbContext.cs
  • microservices/src/employee-service/Infrastructure/Persistence.cs
  • microservices/src/employee-service/Infrastructure/Migrations/20260701173627_InitialEmployeeSchema.cs
  • microservices/src/shared-kernel/Outbox/OutboxMessage.cs
  • microservices/src/shared-kernel/Messaging/

See Also​

Keywords​

  • Transactional outbox
  • Relay boundary
  • Event persistence

Revision Information​

  • Status: Draft
  • Last reviewed: 2026-07-15
  • Review cycle: Quarterly