Asset Ordering and Correlation
Summary
Events carry an occurrence time and a correlation identifier. The relay reads oldest-first, but strict cross-event ordering is not guaranteed by the verified implementation.
Audience
Engineering, integration, QA, architecture, security, and product reviewers.
Reference Content
Correlation
| Field | Where | Purpose |
|---|---|---|
CorrelationId | Contract envelope and outbox row | Trace an event to the originating request |
CausationId | Contract envelope | Present on the envelope; population policy is not asset-specific |
OccurredAtUtc | Domain event, contract, and outbox row | Event time for ordering and audit |
The relay's publish metadata includes EventId, EventType, CorrelationId, TenantId, SourceService, and OccurredAtUtc. Correlation identifiers set on the inbound HTTP request can flow into the outbox row for the resulting operation.
Ordering
AssetOutboxMessageStore.GetPendingAsync returns rows ordered by OccurredAtUtc ascending, capped at the batch size. Within a single relay pass, older rows are published first. However, the verified implementation provides:
- No total ordering guarantee across batches or across service instances.
- No per-asset ordering key or partition in the producer.
- No consumer-side reordering for asset events.
So consumers must not assume strict global or per-asset ordering. Where order matters, the payload's Status and Condition convey the resulting state directly, reducing reliance on delivery order.
Requires confirmation
Any ordering guarantee expected by a downstream consumer, and the CausationId population policy for asset events, require confirmation.
Source References
microservices/src/shared-kernel/Messaging/OutboxProcessor.csmicroservices/src/asset-service/Infrastructure/Persistence.csmicroservices/src/shared-kernel/Outbox/OutboxMessage.cs
Related Articles
See Also
Keywords
- Ordering
- Correlation
- Occurred-at
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly