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

Microprofile, fallback doesn't work on Native mode.

    XMLWordPrintable

Details

    • Hide

      Setup an HttpClient pointing to a not found URL

      @RegisterRestClient(baseUri = "http://microprofile-test:8080/")
      public interface HelloClient {
          
          @GET
          @Path("/hello/notFound")
          @Produces(MediaType.TEXT_PLAIN)
          @Asynchronous
          @Fallback(fallbackMethod = "fallback")
          CompletionStage<String> getWithFallback();
      
          default CompletionStage<String> fallback() {
              return completedFuture("Fallback");
          }
      }
      

      And then make a query:

      @Inject
      @RestClient
      HelloClient hello;
      hello.getWithFallback().thenApply(result -> "Client got: " + result);
      Show
      Setup an HttpClient pointing to a not found URL @RegisterRestClient(baseUri = "http: //microprofile-test:8080/" ) public interface HelloClient { @GET @Path( "/hello/notFound" ) @Produces(MediaType.TEXT_PLAIN) @Asynchronous @Fallback(fallbackMethod = "fallback" ) CompletionStage< String > getWithFallback(); default CompletionStage< String > fallback() { return completedFuture( "Fallback" ); } } And then make a query: @Inject @RestClient HelloClient hello; hello.getWithFallback().thenApply(result -> "Client got: " + result);
    • Undefined
    • +
    • ---

    Description

       I have a microprofile HttpClient on Native mode, and also a fallback action configured, then I got the following exception:

      2021-01-18 10:36:17,661 ERROR [org.jbo.res.res.i18n] (executor-thread-1) RESTEASY002020: Unhandled asynchronous exception, sending back 500: java.lang.RuntimeException: Not implemented in native mode
      

      Github Ref

      Attachments

        Issue Links

          Activity

            People

              lthon@redhat.com Ladislav Thon
              rhn-support-pagonzal Pablo Gonzalez Granados (Inactive)
              Kyrylo Shpak Kyrylo Shpak (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: