EventMessage
Represents a domain event message within the Wow framework's event sourcing architecture.
This interface serves as the base marker for all domain events, providing a comprehensive set of identifiers and metadata necessary for event processing, correlation, and tracking in distributed systems. It combines multiple capability interfaces to provide a complete event representation.
The EventMessage is the fundamental unit of state change in the event sourcing paradigm. Each event represents a fact that has happened in the domain, and together they form an immutable sequence of state changes for aggregates.
Inherited Capabilities
The interface extends multiple capability interfaces, each serving a specific purpose:
NamedBoundedContextMessage: Identifies the bounded context that produced this event
CommandId: Correlates the event with the command that triggered it
NamedAggregate: Identifies the aggregate type that this event belongs to
Version: Tracks the aggregate's version after applying this event
AggregateIdCapable: Identifies the specific aggregate instance
OwnerId: Tracks the owner who created/modified this event
SpaceIdCapable: Supports namespace-based data layering within tenant context
Usage Example
data class OrderCreatedEvent(
override val aggregateId: String,
override val aggregateVersion: Int,
override val commandId: String,
override val tenantId: String,
override val ownerId: String,
override val spaceId: String,
val orderId: String,
val customerId: String,
val totalAmount: BigDecimal
) : EventMessage<OrderCreatedEvent, OrderCreated>
interface OrderCreatedSince
1.0.0
Type Parameters
The concrete type of this event message, used for self-referential typing
The event type marker, typically an empty interface for type-safe event handling
See also
for concrete event implementation
for the command counterpart