HttpCommandCaller
The synchronous calls of a node's sagas to the HTTP command gateways of other contexts: the service mode of the command client (ClientMode.Service), at the base URL endpoints gives each context's internal port (wow.peers.<context>.url), the only one that takes a call; its public port refuses Wow-Call. Each call goes to the command's route as the contracts list it (CommandIndex.routeOf), those of the peers' api jars on the class path by default, as the HttpCommandClient sends one (a command whose body names its aggregate to its route without an id), and carries:
the command's body as JSON, and its expected version as
If-Match;its deterministic request id as
Wow-Request-Id, so every retry and replay is the same request, which the target decides once and answers with the same aggregate;Wow-Call(me.ahoo.wow.api.wire.CallHeader): its command id, the root command's tenant, scope, operator and causation, the root request's facts that propagate, and the wait context a wait that follows the saga goes on with;the calling service's name as
Wow-Service, which makes the target takeWow-Call;the trace the call runs in.
The call waits as long as the wait it goes on with has left, or the calling node's default wait for one that goes on with none (wow.wait.default-timeout, which the host gives it; WaitPlan.DEFAULT_TIMEOUT for a caller of no node), at most the context's timeout: it states that as Wow-Wait-Timeout, and waits for the answer that long and ANSWER_GRACE more, never the transport's whole timeout (wow.peer.timeout, which bounds what has no wait). The target answers 504 at the wait's end, so a target that has not answered by then never will: a call sent on a connection to a node that is gone without closing it (a pod deleted by force) ends then (#6517).
The target answers once the command is committed: 200 with its result, or a problem+json whose result is its REJECTED or FAILED result. A REJECTED result is returned; a FAILED one is its problem's WowProblemException, which keeps the problem's Retry-After for the subscription's backoff (a 504's second, not the backoff's tenth). The outcome is the one it was: a FAILED result returned failed the handler too, as CommandCalls.failure of its code and result, classified alike; only the Retry-After is new. Anything else is a WowProblemException too: an error answered without a result (401 or 403 for a call the target refuses, such as one of a service its lists do not name) as its own code, a connection that fails or no answer within the bound as the transport's (wow.command.unknown, wow.peer.unavailable), and a success the client cannot read as wow.command.failed, retried with the same request id. The saga's handler fails and its subscription retries it, then parks the aggregate. The call itself is not retried here: the subscription's retry budget is the one that counts.
Constructors
The caller of the contexts' internal ports at the fixed endpoints, as the service named service, on client, each call answered within timeout and routed as contracts list its command. It takes fixed URLs where the other takes a resolver, and has one timeout for every context.
The caller of the contexts' internal ports endpoints finds, as the service named service, each call answered within its context's timeout of timeouts, else timeout, and routed as contracts list its command. A call that goes on with no wait waits defaultWait, the calling node's wow.wait.default-timeout. It builds what the internal constructor takes: the transport from the endpoints, and the command index from the contracts.
Functions
Whether the endpoints give context an internal URL: the node does not start when a saga calls a context without one, rather than failing the call later. A resolver that discovers its services says whether it can find one without looking it up (EndpointResolver.reaches), so a peer need not be up then.