ClientRequestFactory RestEasy Deprecated ... Any other alternative to RestEasy?

I need to create a calm client using the RestService interface created by others ... This works well, except for one thing ...

When I upgrade from rest-easy 2.3.5.Final to rest-easy 3.0.x, the ClientRequestFactory class looks like @Deprecated.

Actual code:

ClientRequestFactory crf = new ClientRequestFactory(UriBuilder.fromUri("http://url-of-service").build());
SomeRestInterface client = crf.createProxy(SomeRestInterface.class);
client.theMethod();

Any, now, what is the rest-easy alternative for ClientRequestFactory in version 3.0.x?

+2
source share
1 answer

-API Resteasy Client , JAX-RS Client-API. Resteasy Client-API .

():

Client client = ClientBuilder.newClient();
Response response = client.target("http://url-of-service").request().get();
// read and close the response

- Resteasy:

Client client = ClientFactory.newClient();
ResteasyWebTarget target = (ResteasyWebTarget) client.target("http://url-of-service");
SomeRestInterface client = target.proxy(SomeRestInterface.class);
client.theMethod();
+5

Source: https://habr.com/ru/post/1531673/


All Articles