Skip to main content

Expense Outbox and Delivery

Summary

Expense has an active hosted relay. Pending and Failed rows are selected oldest-first in bounded batches, published sequentially, and changed to Processed after successful broker publication.

Outbox lifecycle

Confirmed

  • Domain-to-contract mapping happens before the local save commits.
  • Outbox event identity is unique.
  • Pending and Failed work is eligible for relay selection.
  • Selection orders by occurrence time within each batch.
  • A publish result indicating unavailability marks the row Failed.
  • Exceptions also mark the row Failed and increment its retry count.
  • The hosted relay catches iteration failures and continues after its polling delay.
  • Successfully published rows are marked Processed.

Not implemented

  • Expense-specific dead-letter storage
  • Retry ceiling
  • Exponential backoff
  • Poison-message quarantine
  • Administrative replay command
  • Exactly-once delivery guarantee

Requires confirmation

Relay monitoring, manual recovery ownership, retention of Processed rows, operational alerts, and safe replay procedures require confirmation.

Source References

  • microservices/src/expense-service/Infrastructure/ExpenseDbContext.cs
  • microservices/src/expense-service/Infrastructure/Persistence.cs
  • microservices/src/shared-kernel/Outbox/OutboxMessage.cs
  • microservices/src/shared-kernel/Messaging/OutboxProcessor.cs
  • microservices/src/expense-service/Messaging/OutboxRelayHostedService.cs

See Also

Keywords

  • Expense events
  • Outbox and Delivery
  • Integration contracts

Revision Information

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