JavaCommandClient
The CommandClient for Java callers: the same calls, the in-process client's or a peer's over HTTP alike, without coroutines or Kotlin types. Each call is blocking (send, sendAndWait, stream) or asynchronous (sendAsync, sendAndWaitAsync); see JavaFlows for which thread runs them. Each takes a CommandRequest, or a command and the id of the aggregate it goes to (none for a creation), its type derived from the command's class.
JavaCommandClient commands = JavaCommandClient.of(commandClient).of(caller);
CommandResult result = commands.sendAndWait(new SubmitOrder(items));
commands.sendAndWait(CommandRequest.builder(new PayOrder(amount)).id(orderId).wait(WaitPlan.COMMITTED).build());A rejection is a me.ahoo.wow.api.client.CommandRejectedException, a technical failure a me.ahoo.wow.api.problem.WowProblemException, both unchecked; an asynchronous call's future completes with them.
Functions
This client sending as caller (CommandClient.of).
Sends request and answers once it is accepted (CommandClient.send).
Sends request and answers with the result its wait plan ends with (CommandClient.wait).
sendAndWait, asynchronously.
send, asynchronously.
The results of request's wait, one per hop (CommandClient.stream), sent as the stream is made; close it (try-with-resources) to stop reading early.