New in the 0.4.0-SNAPSHOT development line — everything listed here landed after the 0.3.0 release and is not part of it. Every entry links to the section that documents it, and those sections carry the NEW badge. Each brick of the suite keeps its own page of this kind; the ecosystem index gathers them. When the next release train ships, this page is frozen with it and restarts empty on the dev line.
The module path and jlink
A Rest Client now works on a strict module path and in a jlink image, with nothing to add to the application’s module-info:
-
RestClientBuilder.newBuilder()works on the module path — it used to throwServiceConfigurationError, because the descriptors did not declare theServiceLoaderlookups the specification makes.io.vidocq.cyrano.mp.rest.client.apinow declaresuses RestClientBuilderResolveranduses RestClientBuilderListener, andio.vidocq.cyrano.coredeclaresuses RestClientBuilderListeneranduses RestClientListener.@Inject @RestClientgoes throughnewBuilder(), so it was affected too, on the Vidocq runtime as well. A listener another module provides — theRestClientListenerof humboldt-rest, for example — is now found. Exported Java modules, Builder and client listeners. -
A runtime-fallback proxy for an interface of another named module — when an interface has no proxy generated by
cyrano-processor,cyrano-coredefines one at run time in the interface’s package. For an interface of another named module, that failed even after the module did what the error message asked. The module now declares only theopens <package> to io.vidocq.cyrano.corethe message names: it does not have to readcyrano-core, and no--add-readsor--add-exportsis needed. With the proxy generated at compile time bycyrano-processor, the module still needs noopensat all. Tier 3: runtime generation. -
Reactive Streams is an optional dependency —
org.reactivestreams:reactive-streamsis an automatic module, and it came withcyrano-coreinto every Rest Client application, sojlinkrefused to link any of them (jlink does not support automatic modules: org.reactivestreams). It is nowoptional: a Rest Client application links. An application whose client methods returnPublisher(server-sent events) must declare the dependency itself, and such an application cannot be linked with jlink until an explicitorg.reactivestreamsmodule exists. Reactive Streams forPublisher.
Behaviour changes
What an upgrading application has to do, for these changes and for the module-path ones above, is summed up in Upgrading from 0.3.0.
-
onNewBuilderruns once per builder —RestClientBuilder.newBuilder()notified everyRestClientBuilderListenerup to three times for one builder: once from the API, once from Cyrano’s resolver and once more frombuild(). It now notifies each listener once, when the builder is created, as the specification says, and never frombuild().RestClientListener.onNewClientstill runs once perbuild(). A listener that counted its calls sees fewer. Builder and client listeners. -
Asynchronous responses never run on the caller’s thread — with no
executorServiceon the builder, a method returningCompletionStageprocessed a response that was already complete — response filters, readers,AsyncInvocationInterceptor.applyContext— on the thread that called the method, and so was a request aborted by a filter. Each response is now processed on a new virtual thread. An executor service set on the builder is used, as before. Async —CompletionStage<T>. -
@RestClientbeans for the application’s own interfaces at build time — when the CDI extension runs inside the Vauban annotation processor, as on the Vidocq runtime, the@RegisterRestClientinterface is being compiled and cannot be loaded, and the extension skipped it silently: no@RestClientbean, and@Inject @RestClientfailed with an unsatisfied dependency. The bean is now declared from the compiler’s model of the interface, and the interface is loaded when the client is built. It needs the matching Vauban0.4.0line. Discovery: Vauban BCE.
Other CDI containers
-
Proven on Weld and Open Liberty — two new test modules run the Cyrano jars, unchanged, without Vauban:
cyrano-it-weldon Weld SE 6.0 (class path),cyrano-it-openlibertyas a WAR on Open Liberty 26.0.0.10 (MicroProfile 7, CDI 4.0) with Liberty’s ownmpRestClientoff. Both cover a processor-generated proxy and the run-time fallback. Neither is published (cyrano#34). Other CDI containers. -
The Jakarta REST API is
provided—cyrano-apiandcyrano-mp-rest-client-apino longer shipjakarta.ws.rs-api; the runtime brings it (vidocq-workspace#17). This is a behaviour change for an application that compiled against Jakarta REST through Cyrano alone: it now declares the API itself. On the Vidocq runtime, the Rest Client extension brings it, together with Champollion’s JSON-B implementation, which it used to leave to the REST extension. Runtime prerequisites.