|
Cyrano is at |
Cyrano implements MicroProfile Rest Client 4.0 strictly. Migration means aligning annotations with the spec and giving up the proprietary extensions of existing implementations.
Upgrading from 0.3.0 NEW
What changes for an application that moves from Cyrano 0.3.0 to the 0.4.0-SNAPSHOT line (full list: What’s new):
-
Client methods returning
Publisher— declareorg.reactivestreams:reactive-streamsyourself:cyrano-coreno longer brings it. Every other application drops an automatic module and can be linked with jlink. Reactive Streams forPublisher. -
Interfaces without a
cyrano-processorproxy, in a named module — keep onlyopens <package> to io.vidocq.cyrano.core, and remove any--add-reads io.vidocq.cyrano.core=…or--add-exports io.vidocq.cyrano.core/io.vidocq.cyrano.internal=…added to make the runtime-fallback proxy work. Withcyrano-processoron the processor path, noopensis needed. Tier 3: runtime generation. -
RestClientBuilderListener—onNewBuildernow runs once per builder, where it ran up to three times. A listener that counted calls, or relied on the call frombuild(), needs updating. Builder and client listeners. -
CompletionStagemethods — response filters, readers andAsyncInvocationInterceptor.applyContextno longer run on the caller’s thread when the response is already complete. Code that relied on running there (aThreadLocalset by the caller, say) must propagate its context throughAsyncInvocationInterceptor. Async —CompletionStage<T>.
From SmallRye Rest Client
SmallRye is the implementation used by Quarkus and WildFly. Its spec fidelity is high; porting is conceptually direct.
| SmallRye | Cyrano | Note |
|---|---|---|
|
|
Identical (MP spec). |
|
|
Identical. |
|
|
Identical. Resolved via |
|
|
No Vert.x configuration. Vert.x connection-pool settings have no equivalent — the pool is internal to |
|
No equivalent in Cyrano |
Use Heisenberg (MP Fault Tolerance) alongside. |
OpenTelemetry propagation via SmallRye OTel |
Via Humboldt server-side + W3C propagator |
To be documented. |
Quarkus-style |
|
Namespace switch. Official MP Config keys are preserved. |
|
Same |
Identical. |
Dev mode (hot reload) |
Standard Maven cycle |
No dev-mode equivalent for now. |
From RESTEasy MicroProfile Rest Client
RESTEasy exposes the same MP Rest Client API plus a proprietary extension layer.
| RESTEasy | Cyrano | Note |
|---|---|---|
|
|
Identical. |
|
|
Zero external dependency. No Apache HC config to port — JDK |
|
Not supported |
Multipart is not covered by MP Rest Client 4.0. |
|
Standard |
The JAX-RS Client fluent API is not the MP Rest Client operating mode (typed interface only). |
|
Same |
Identical. |
|
|
The Cyrano client is an interface proxy, not a |
|
|
Standard JAX-RS — identical declarations. |
Logging via |
|
Both listener SPIs of the specification (§10.1, §10.2) are supported, found with |
From Jakarta REST Client (no MicroProfile)
The jakarta.ws.rs.client.Client + WebTarget mode is fluent and imperative; Cyrano is declarative via interface. Porting requires more effort.
| Jakarta REST Client | Cyrano | Note |
|---|---|---|
|
|
Required refactor — extract each HTTP call into an annotated interface method. |
Instance per call |
One proxy per client, shared |
Bonus: no connection leak, shared |
|
Method returning |
Same semantics, more natural signature. |
Imperative configuration |
Annotations + MP Config |
More declarative, more testable. |
To preserve jakarta.ws.rs.client.Client usage in edge cases (e.g. fully dynamic URL), it remains legal to instantiate a standard JAX-RS Client alongside Cyrano — the two coexist.
Known pitfalls
-
module-info.java— remember to addrequires io.vidocq.cyrano.mp.rest.client.api;andopens com.example.dto to jakarta.json.bind;for the DTOs. This is the number-one source ofInaccessibleObjectException. -
Spec repackage — do not import
microprofile-rest-client-apidirectly (automatic module → jlink-incompatible). Always go throughcyrano-mp-rest-client-api. -
MP Config is required for
<configKey>/mp-rest/url— without Ravel (or another impl), only@RegisterRestClient(baseUri=…)works.
Going further
-
Getting started — first typed client in under 50 lines.
-
Concepts — MP Rest Client vocabulary.
-
TCK — current conformance status.