CommandSender
Sends commands to the command topics of other contexts: how a saga's command reaches an aggregate of a context outside its own.
Type: the command's full type name (
ctx.agg.Command) is the one the contracts give its class (ContractDirectory.commandTypeOf of the schema#/$defs/<binary name>): the target's Manifest, or a peer's contract, which reaches the service in the jar of the context's api module; a class several aggregates decide is named on the command's. A class no Manifest declares, or one of another aggregate than the command's, fails the send.Topic and partition:
wow.<ctx>.commandsafter the prefix (SourceTopics.commandsOf), in the partition the log's Partitioner gives the aggregate among the topic's partitions, which the target keeps equal to its log's, so the owner of the aggregate's log partition reads it; a creation that names no aggregate goes by its request instead (CommandMessages.laneOf), and the intake that reads it forwards it to the owner of the id it assigns. The partition count is read once per topic; a topic without partitions fails the send.Durable ACCEPTED: send returns once the broker has acknowledged the message; it throws when it has not, and the caller retries with the same command, which the target does not decide twice.
Trace: the message carries the trace the sender runs in, which the target's intake continues.
Functions
Sends commands, each with the ReplyTo of its receipt, to their contexts' command topics, with wait: those of one topic as one batch, in their order, so the commands to one aggregate keep theirs in its partition. Returns once the broker has acknowledged every batch; throws when it has not acknowledged one.