Events¶
Target Architecture — Final-State Design
This page describes the final-state messaging contract of the Marketplace Platform. All messages travel in the canonical event envelope over MassTransit on Azure Service Bus. Events use NounVerbPastTense; commands use VerbNoun, per Naming Conventions.
The Marketplace is event-driven end to end. Commands express intent to a single aggregate; domain events record facts within a bounded context; and integration events promote selected facts to a cross-platform contract consumed by the Knowledge, Observability, and Governance platforms.
Commands¶
Commands are imperative, handled by exactly one aggregate, and are not part of the public event stream.
| Command | Target Aggregate | Issued By | Result Event |
|---|---|---|---|
PublishAsset |
MarketplaceAsset / AssetVersion | Publisher (Portal/API) | AssetPublished |
ReleaseAssetVersion |
AssetVersion | Publisher / publishing saga | AssetVersionReleased |
ScanAssetQuality |
AssetVersion | Publishing saga | AssetQualityScanned |
EvaluateCompatibility |
AssetCompatibility | Installation saga / API | CompatibilityEvaluated |
ResolveDependencies |
AssetDependency | Installation saga | DependenciesResolved |
InstallAsset |
AssetInstallation | Agent Mesh / Studio | AssetInstalled |
GrantLicense |
License | Installation saga / Commerce | LicenseGranted |
RegisterPublisher |
Publisher | Admin / onboarding | PublisherRegistered |
ReviewAsset |
AssetReview | User | AssetReviewed |
CreatePricingPlan |
PricingPlan | Admin / Publisher | PricingPlanPublished |
Domain events¶
Domain events are facts emitted by an aggregate after a state change, published within the owning bounded context.
| Event | Emitting Aggregate | Context | Meaning |
|---|---|---|---|
AssetCatalogued |
MarketplaceAsset | Catalog & Search | An asset became visible in the catalog. |
AssetIndexed |
(search read model) | Catalog & Search | A search/index document was (re)built. |
AssetQualityScanned |
AssetVersion | Publishing & Versioning | A quality scan produced a verdict. |
AssetPackagePublished |
AssetPackage | Publishing & Versioning | A distributable package was promoted to a store. |
DependencyConflictDetected |
AssetDependency | Compatibility & Dependencies | A dependency conflict blocked resolution. |
AssetInstallationFailed |
AssetInstallation | Installation | An installation failed and rolled back. |
LicenseRevoked |
License | Commerce | A license/entitlement was revoked. |
PriceQuoted |
PricingPlan | Commerce | A price quote was produced for an asset. |
PublisherVerified |
Publisher | Publisher | A publisher passed verification / trust review. |
RatingAggregated |
AssetReview | Reviews | A new aggregate rating was computed. |
Integration events¶
These are the versioned, cross-platform events promoted from domain events and listed in the factory event catalog. They are the contract other platforms consume.
| Integration Event | Promoted From | Primary Consumers | Payload highlights |
|---|---|---|---|
AssetPublished |
Publishing & Versioning | Knowledge, Observability, Search | assetId, assetType, publisherId, initial version |
AssetVersionReleased |
Publishing & Versioning | Catalog, Search, Compatibility, Knowledge | assetId, version, packageRef, signed, dependencies |
AssetInstalled |
Installation | Knowledge, Observability, Generated SaaS, Governance | installationId, assetId, version, target, requestedBy |
CompatibilityEvaluated |
Compatibility & Dependencies | Installation, Observability | assetId, version, target, verdict, findings |
AssetReviewed |
Reviews | Catalog, Search, Publisher | assetId, rating, reviewerId, aggregateRating |
LicenseGranted |
Commerce | Installation, Generated SaaS, Governance | licenseId, assetId, tenantId, pricingPlanId, expiresAt |
Canonical envelope¶
Every event uses the shared event envelope. Example AssetInstalled:
{
"eventId": "evt-7b3c1f9a-2e44-4c1a-9b6d-0f2a8c3d5e10",
"eventType": "AssetInstalled",
"tenantId": "connectsoft",
"projectId": "proj-booking-saas",
"moduleId": "module-billing-agentpack",
"traceId": "trace-9f1c2b7d",
"correlationId": "corr-3a6e1d40",
"causationId": "evt-compatibility-evaluated-id",
"occurredAt": "2026-06-11T12:05:00Z",
"payload": {
"installationId": "inst-5e2a",
"assetId": "asset-7c1f",
"assetType": "AgentPack",
"version": "2.4.0",
"target": { "projectId": "proj-booking-saas", "environment": "development" },
"resolvedDependencies": [
{ "assetId": "asset-billing-lib", "version": "1.3.0" }
],
"licenseId": "lic-88a2",
"requestedBy": "task-4d21"
}
}
Selected fields mirror into Service Bus application properties (cs-event-type, cs-tenant-id, cs-trace-id, cs-correlation-id, cs-schema-version) so subscriptions can filter without deserializing the body.
Event-flow diagram¶
sequenceDiagram
participant Pub as Publisher
participant APS as AssetPublishingService
participant QSW as AssetQualityScanWorker
participant AVS as AssetVersionService
participant Cat as MarketplaceCatalogService
participant Agent as Agent Mesh
participant Inst as AssetInstallationService
participant Lic as LicenseService
Pub->>APS: PublishAsset
APS->>QSW: ScanAssetQuality
QSW-->>APS: AssetQualityScanned
APS->>AVS: ReleaseAssetVersion
AVS-->>Cat: AssetVersionReleased
APS-->>Cat: AssetPublished
Agent->>Inst: InstallAsset
Inst->>Inst: EvaluateCompatibility
Inst-->>Agent: CompatibilityEvaluated
Inst->>Lic: GrantLicense
Lic-->>Inst: LicenseGranted
Inst-->>Agent: AssetInstalled
Topics and subscriptions¶
Events are published to per-context Azure Service Bus topics; consumers subscribe with rule filters on cs-event-type and cs-tenant-id.
| Topic | Publisher context | Representative events |
|---|---|---|
marketplace.publishing |
Publishing & Versioning | AssetPublished, AssetVersionReleased, AssetQualityScanned, AssetPackagePublished |
marketplace.catalog |
Catalog & Search | AssetCatalogued, AssetIndexed |
marketplace.compatibility |
Compatibility & Dependencies | CompatibilityEvaluated, DependenciesResolved, DependencyConflictDetected |
marketplace.installation |
Installation | AssetInstalled, AssetInstallationFailed |
marketplace.commerce |
Commerce | LicenseGranted, LicenseRevoked, PricingPlanPublished, PriceQuoted |
marketplace.reviews |
Reviews | AssetReviewed, RatingAggregated |
marketplace.publisher |
Publisher | PublisherRegistered, PublisherVerified |
Versioning and consumer rules¶
eventTypenames are stable; breaking changes append a version suffix (e.g.AssetVersionReleasedV2) and bumpcs-schema-version.- Consumers deduplicate on
eventId, tolerate unknown payload fields, and ignore-and-log unknown event types. - Integration events are immutable once published, enabling replay by the Knowledge and Observability platforms.
Continue to Aggregate Roots, Workflows, and the reference Event Envelope.