Skip to content

Event Standard

Executive Summary

Event Standard defines engineering rules for internal events in the Spring Boot Modulith. Events coordinate cross-module workflows and carry business facts that already happened.

Event Rules

Rule Requirement
Past tense Event names describe facts that happened.
Source module publishes The module that owns the fact publishes the event.
Consumers are idempotent Duplicate delivery must not corrupt state.
Tenant metadata required TenantId and OrganizationId are required for customer-scoped events.
No source ownership transfer Consumers react but do not own publisher facts.
Version events Event contracts require versioning as they evolve.
Audit material events Important publication and consumption outcomes are auditable.

Event Flow

sequenceDiagram
    participant App as Application Service
    participant Domain as Domain Model
    participant Outbox as Outbox Boundary
    participant EventBus as Internal Event Bus
    participant Consumer as Consumer Module

    App->>Domain: Execute command
    Domain-->>App: Produce domain event
    App->>Outbox: Record event when reliability is required
    Outbox->>EventBus: Publish event
    EventBus->>Consumer: Deliver event
    Consumer-->>Consumer: Process idempotently

Outbox Pattern

The outbox pattern is the future-safe reliability boundary. It should be used for events that coordinate workflows, integrations, analytics, notifications, AIOS, or future external delivery.

Candidate Events

Module Example Published Events
organization OrganizationOnboarded, OrganizationProfileUpdated.
compliance ComplianceEvidenceUploaded, ComplianceRiskRaised.
opportunity OpportunityDiscovered, OpportunityMatched.
bid BidWorkspaceCreated, BidApprovalRequested.
intelligence AIRecommendationProduced, MemoryUpdateProposed.