DomainEvent

DomainEvent .

Events published when a command is processed by the aggregate

由聚合发布的领域事件 .

领域事件推荐使用声明式(Declarative)设计的方式(幂等,类似于 Kubernetes apply、Docker 镜像层) 即聚合根在事件朔源时只需要简单的将领域事件作为覆盖层(onSourcing 只对状态赋值,没有逻辑判断), 事件朔源将可以不需要显式定义朔源函数。

Author

ahoo wang

Properties

Link copied to clipboard
abstract override val aggregateId: AggregateId
Link copied to clipboard
abstract val aggregateName: String

aggregate name.

Link copied to clipboard
abstract val body: T
Link copied to clipboard
abstract val commandId: String

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.

Link copied to clipboard
abstract val contextName: String
Link copied to clipboard
abstract val createTime: Long
Link copied to clipboard
abstract val header: Header
Link copied to clipboard
abstract val id: String

Represents a unique identifier for the implementing entity.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open val isLast: Boolean

是否为事件流的最后一个事件

Link copied to clipboard
Link copied to clipboard
abstract val name: String
Link copied to clipboard
abstract val ownerId: String

资源拥有者Id

Link copied to clipboard
open override val revision: String

Represents the revision of the domain event. This value is used to track changes or updates in the domain model, ensuring that each version of an aggregate can be uniquely identified and managed.

Link copied to clipboard
open val sequence: Int
Link copied to clipboard
abstract val version: Int

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun withHeader(additionalSource: Map<String, String>): DomainEvent<T>

合并 header 并返回一个新的 Message.

open fun withHeader(key: String, value: String): DomainEvent<T>
Link copied to clipboard