Asset Producer Behavior
Summary
Asset-service is the single producer of all six asset events. Emission is a side effect of a successful lifecycle save; it is not a separate publish call in the command code.
Audience
Engineering, integration, QA, architecture, and security reviewers.
Reference Content
Producer identity
Every asset contract sets SourceService = "asset-service". No other service produces these contracts in the verified source.
Emission model
Commands mutate the aggregate, which raises a domain event. Persistence emits the contract:
- A command calls an aggregate method (for example
Assign), which callsRaise(...). - The command saves through the unit of work.
AssetDbContext.SaveChangesAsyncdispatches each raised domain event to the outbox, then commits.
The producer therefore emits exactly one contract per raised domain event per save, guarded for completeness before staging.
Producer guarantees (verified)
| Property | Verified behavior |
|---|---|
| Atomicity with state | Outbox rows commit in the same transaction as the aggregate change |
| Completeness | EnsureComplete blocks incomplete payloads before staging |
| Ordering at emission | Rows carry OccurredAtUtc; the relay reads oldest-first |
| At-least-once intent | Failed publishes remain eligible for retry |
| Duplicate suppression at producer | None; the producer may re-publish a Failed row |
Producer non-guarantees (verified)
- The producer does not confirm broker receipt synchronously.
- The producer does not deduplicate on the publish side; idempotency is a consumer responsibility (see Idempotency).
- The producer does not enforce cross-aggregate ordering.
Source References
microservices/src/asset-service/Infrastructure/AssetDbContext.csmicroservices/src/asset-service/Application/Commandsmicroservices/src/asset-service/Domain/Asset/Asset.cs
Related Articles
See Also
Keywords
- Event producer
- Outbox emission
- At-least-once
Revision Information
- Status: Draft
- Last reviewed: 2026-07-17
- Review cycle: Quarterly