WowClient
The typed clients of the peers' HTTP routes, all on one JDK HttpClient and one EndpointResolver, in one ClientMode: commands sends command objects as the location-transparent CommandClient does in process, and queries reads their snapshots, events, datasets and states as the QueryApi does. A peer's commands and state classes are found in the contract its api jar carries, read from the class path: a consumer depends on the peer's *-api and writes no path.
Build it with builder, naming its mode: Builder.service or Builder.user. Close it when done: it closes the JDK client it built, not one it was given (Builder.httpClient).
WowClient.builder()
.endpoints(EndpointResolver.of(emptyMap(), mapOf("eshop-ordering" to URI.create("http://ordering:9090"))))
.service("basket-service")
.build()
.use { client ->
client.commands.of(caller).wait(CommandRequest.to(EshopOrderingContract.Order.ref(tenantId, id), body))
}Types
Properties
The command client, sending as an anonymous caller until CommandClient.of gives it another.
The query client of the peers' read routes, for a caller (QueryApi.of); see HttpQueryApi.
Functions
The Manifest of context, a peer described by its Manifest alone (Builder.manifestPeers), read from its GET /wow/manifest as caller and kept a minute, as the NamedCommands to it are checked against: what a console or a gateway offers of its commands.