DomainEvent
DomainEvent .
Events published when a command is processed by the aggregate
由聚合发布的领域事件 .
领域事件推荐使用声明式(Declarative)设计的方式(幂等,类似于 Kubernetes apply、Docker 镜像层) 即聚合根在事件朔源时只需要简单的将领域事件作为覆盖层(onSourcing 只对状态赋值,没有逻辑判断), 事件朔源将可以不需要显式定义朔源函数。
Author
ahoo wang
Properties
聚合ID,用于唯一标识一个聚合实例
Represents a unique identifier for a command. This identifier is crucial for ensuring that each command can be uniquely identified, which is particularly useful in scenarios where idempotency of commands needs to be guaranteed or when tracking and correlating commands across system boundaries.
The create time of the message, represented as a Unix timestamp in milliseconds.
Indicates whether the message is read-only, based on the state of the header.
Functions
检查两个聚合根是否属于同一个上下文并具有相同的聚合根名称。
Adds all entries from the provided map to the message header and returns the message itself for method chaining.
Adds a key-value pair to the message header and returns the message itself for method chaining.
Marks the message as read-only and returns the message itself for method chaining.