Skip to main content

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:

  1. A command calls an aggregate method (for example Assign), which calls Raise(...).
  2. The command saves through the unit of work.
  3. AssetDbContext.SaveChangesAsync dispatches 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)

PropertyVerified behavior
Atomicity with stateOutbox rows commit in the same transaction as the aggregate change
CompletenessEnsureComplete blocks incomplete payloads before staging
Ordering at emissionRows carry OccurredAtUtc; the relay reads oldest-first
At-least-once intentFailed publishes remain eligible for retry
Duplicate suppression at producerNone; 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.cs
  • microservices/src/asset-service/Application/Commands
  • microservices/src/asset-service/Domain/Asset/Asset.cs

See Also

Keywords

  • Event producer
  • Outbox emission
  • At-least-once

Revision Information

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