SimpleCommandMessage

constructor(id: String = generateGlobalId(), header: Header = DefaultHeader.empty(), body: C, aggregateId: AggregateId, ownerId: String = OwnerId.DEFAULT_OWNER_ID, requestId: String = id, aggregateVersion: Int? = null, name: String = body.javaClass.toName(), isCreate: Boolean = false, allowCreate: Boolean = false, isVoid: Boolean = false, createTime: Long = System.currentTimeMillis())

Parameters

C

The type of the command body.

id

Unique identifier for the command message. Defaults to a generated global ID.

header

Message header containing metadata. Defaults to an empty header.

body

The actual command payload.

aggregateId

Identifier of the aggregate this command targets.

ownerId

Identifier of the owner/user initiating the command. Defaults to default owner.

requestId

Identifier for request deduplication. Defaults to the message ID.

aggregateVersion

Expected version of the aggregate for optimistic concurrency. Null means no version check.

name

Human-readable name of the command. Defaults to the simple class name of the body.

isCreate

Whether this command creates a new aggregate instance.

allowCreate

Whether creation is allowed if the aggregate doesn't exist.

isVoid

Whether this is a void command that doesn't produce events.

createTime

Timestamp when the command was created. Defaults to current time.