0
I have a web application where at a certain time I make requests on a endpoint
using JAX-RS RestEasy
as follows:
// Outros códigos acima
@Inject
private Client client;
...
WebTarget webTarget = client.target(URL).path(ENDPOINT);
Response response = webTarget.request().post// continua
Until then I can normally perform the POST, however, I need to consider setting the HTTP timeout for this operation. Researching I realized that the staff uses the Jersey to carry out the following configuration:
client.property(ClientProperties.CONNECT_TIMEOUT, 1000);
client.property(ClientProperties.READ_TIMEOUT, 1000);
I don’t use this dependency in the project and, just for testing, I tried using and running the application in Wildfly a number of exceptions and conflicts arise due to conflicts with other necessary dependencies.
An important observation is that the object client is injected via ICD.
Well, I wonder how I could define the timeout without using this Jersey dependency?