Uploaded image for project: 'Quarkus'
  1. Quarkus
  2. QUARKUS-863

Quarkus Rest Client Mutiny documentation is not accurate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.13.9.GA
    • 1.11.GA
    • team/eng
    • None
    • Undefined
    • ---

       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. 

            cescoffi@redhat.com Clement Escoffier
            rhn-support-pagonzal Pablo Gonzalez Granados (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: