Asset Outbox and Messaging Operations
Summary
This page documents how the asset-service stages and relays domain events using a transactional outbox. Events are written to outbox rows in the same transaction as the domain change, then a background relay polls and publishes them to the shared RabbitMQ event bus. The relay is resilient — a publish failure leaves rows for re-processing and never blocks the writing request — but there is no retry ceiling, backoff, dead-letter, or cleanup. A read-only diagnostics endpoint exists for inspection only.
Audience
- DevOps engineers operating the messaging path.
- Support and QA engineers investigating event delivery.
- Solution architects assessing delivery guarantees.
Reference Content
Outbox row shape
| Field | Purpose |
|---|---|
| Id, EventId | Row and event identity |
| EventType | The domain event type |
| PayloadJson | Serialized event payload |
| OccurredAtUtc, ProcessedOnUtc | Timing of creation and processing |
| Status | Pending / Processing / Processed / Failed |
| RetryCount, ErrorMessage | Failure accounting |
| CorrelationId, TenantId, SourceService | Traceability and tenancy |
Relay behavior
The relay is OutboxRelayHostedService, a background service that polls every 10 seconds with a batch size of 50 and resolves IOutboxProcessor per iteration in its own scope. A failure during relay simply leaves rows in Pending or Failed state and never blocks the request that wrote them.
Status transitions
OutboxProcessor.GetPending returns rows in Pending or Failed state ordered by OccurredAtUtc, so failed rows are naturally retried on subsequent polls. Success marks the row Processed; failure marks it Failed with an incremented retry count and recorded error.
Delivery boundaries
- No retry ceiling and no backoff — failed rows are retried indefinitely on each poll.
- No dead-letter path.
- No cleanup or archival of processed rows.
- Broker delivery depends on broker availability and configuration and is not verified here.
Safe diagnostics
A read-only diagnostics endpoint (/asset/outbox?take=N) projects row metadata using AsNoTracking. It is for inspection only. This documentation intentionally provides no replay, edit, or manual-requeue instructions.
Source References
microservices/src/asset-service/Messaging/OutboxRelayHostedService.csmicroservices/src/shared-kernel/Messaging/OutboxProcessor.csmicroservices/src/shared-kernel/Extensions/MessagingExtensions.cs
Related Articles
See Also
Keywords
asset outbox, event relay, messaging, unbounded retry, no dead-letter
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly