CommandMessages
The messages of the command and receipts topics, each an Envelope:
Command (EnvelopeKind.COMMAND):
idis the command id,typeits full type name (ctx.agg.Command),payloadits wire form (CommandWire, withreplyTowhen a saga sent it),transportits wait context, if any. Keyed by the aggregate ref (laneOf: a creation that names no aggregate by its request); its partition is the one the log's partitioner gives that ref among the topic's partitions, which are the target context's log partitions.Receipt (EnvelopeKind.COMMAND_RECEIPT):
idis the rejected command's id, the one a reader deduplicates by,typeits type,payloadthe rejection as the saga's@OnRejectedhandler takes it,{commandId, commandType, ref, error, causation, executionId, operator, scope, headers}(headersthe command's request facts that propagate), without the command's body. Keyed by the ref of the commit the saga handled, so the receipts of one saga aggregate keep their order. A success receipt, the same kind and id, carries the commit instead:{commandId, commandType, ref, version, result, causation, executionId, operator, scope, headers}, itsresultthe command's CommandResult at itscommittedhop, no state.
Bodies and payloads are read and written with the cluster channel's lenient mapper (ClusterCodec): unknown fields are ignored, and numbers keep their exact value.
Functions
The command envelope holds.
The commit the success receipt envelope holds.
The success receipt of committed: id is the command's id, as a rejection's, and payload {commandId, commandType, ref, version, result, causation, executionId, operator, scope, headers}, without the state, carrying the propagation fields of its trace and, in its transport, the wait of the command it answers past its commit: the rest of the chain, whose next hop is the saga's @OnCommitted handler.
What the receipt envelope holds: a CommandReceipt.Committed when its payload carries a result, else a CommandReceipt.Rejected.
The rejection the receipt envelope holds.