0

I started playing around with Quarkus and its REST client. According to the documentation a Jax-RS annotated interface should be created and annotated further with @RegisterRestClient.

My issue is that I already have the JaxRS interfaces for the services I need to connect to, in an artifact provided by the server, which I can just import. Is there a way to use an already created external Jax-RS interface to create a service with? It seems so wrong to copy-paste the code for a perfectly good interface, when it has been so nicely served for me.

Martin Nielsen
  • 1,865
  • 6
  • 30
  • 54

1 Answers1

1

There's RestClientBuilder, which allows programmatic usage of JAX-RS interfaces. Assuming the JAX-RS interface is called HelloClient, you can do this:

HelloClient client = RestClientBuilder.newBuilder()
    .baseUri(URI.create("http://localhost:8080"))
    .build(HelloClient.class);
Ladicek
  • 5,970
  • 17
  • 20
  • That sounds awesome. Can you be persuaded to update your reply with a way to disable the SSL checks, and even better, add basic auth? – Martin Nielsen Jun 23 '21 at 11:36