quarkus-rest-client-mutiny, it's just for those that are looking for an async HTTP client with Mutiny flavor, and quarkus-resteasy-mutiny brings client and server-side, isn't (mutiny flavor)?.
I think that we should put more emphasis on which dependencies are required on Async Server API / Client:
https://quarkus.io/guides/rest-client#async-support
Because to me, when I read:
Async support comes in 2 flavors: you can return a CompletionStage or a Uni (requires the quarkus-rest-client-mutiny extension).
And then I have a look at the examples:
Client side:
package org.acme.rest.client; import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; import org.jboss.resteasy.annotations.jaxrs.PathParam; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import java.util.concurrent.CompletionStage; import java.util.Set; @Path("/v2") @RegisterRestClient public interface CountriesService { // ... @GET @Path("/name/{name}") @Produces("application/json") Uni<Set<Country>> getByNameAsUni(@PathParam String name); }
Server-side:
package org.acme.rest.client; import org.eclipse.microprofile.rest.client.inject.RestClient; import org.jboss.resteasy.annotations.jaxrs.PathParam; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.concurrent.CompletionStage; import java.util.Set; @Path("/country") public class CountriesResource { @Inject @RestClient CountriesService countriesService; // ... @GET @Path("/name-uni/{name}") public Uni<Set<Country>> nameAsync(@PathParam String name) { return countriesService.getByNameAsUni(name); } }
Firstly I don't see any Mutiny dependency on imports (that it's weird), but also looks that we only need 'quarkus-rest-client-mutiny' library. I expected some server lib as 'quarkus-resteasy-mutiny'.
And indeed if you have a look at the quickstart pom that this guide is pointing, we can see the expected lib . And also, the missing import
We should review the quick start guide and improve it with some clarification related to mutiny client/server dependencies and add missing imports.
- is blocked by
-
QUARKUS-712 Tech preview of Rest Client support for Uni (Mutiny)
-
- Closed
-