2

I have a custom Quarkus extension built with quarkus 2.16.4.Final, which uses quarkus-rest-client-reactive-jackson to create a rest client of a JAXRS interface:

import javax.ws.rs.POST;
import javax.ws.rs.PathParam;


public interface MyContract {

    @POST
    @Path("/v2/apps/{appId}")
    void register(@PathParam("appId") AppNameDTO var1);
}

And I am building a client for it like this, in my extension:

return RestClientBuilder.newBuilder()
    .baseUri(URI.create(target))
    .connectTimeout(500, TimeUnit.MILLISECONDS)
    .readTimeout(5000, TimeUnit.MILLISECONDS)
    .build(MyContract.class);

When I use the extension in my Quarkus app, I get this error:

2023-03-12 15:27:36,627 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile [dev]): java.lang.IllegalArgumentException: Not a REST client interface: interface com.{snip}.quarkus.{snip}.extension.client.MyContract. No @Path annotation found on the class or any methods of the interface and no HTTP method annotations (@POST, @PUT, @GET, @HEAD, @DELETE, etc) found on any of the methods
    at org.jboss.resteasy.reactive.client.impl.ClientProxies.get(ClientProxies.java:32)
    at org.jboss.resteasy.reactive.client.impl.WebTargetImpl.proxy(WebTargetImpl.java:449)
    at io.quarkus.rest.client.reactive.runtime.RestClientBuilderImpl.build(RestClientBuilderImpl.java:347)

At first I thought it was because I was using Jakarta annotations somewhere, but nope, they're all javax. Then I added a @Path annotation on the interface, which wasn't necessary in the past, but that didn't work either. Both the interface and the client are in the same package in the extension, so I'm sure it's not related to some external dependency pruning. What is wrong with this code?

Rahul
  • 21
  • 2

0 Answers0