How to set a timeout on resteasy client in JBoss EAP 7?

Solution Verified - Updated -

Issue

  • Which code should be used in order to be able to configure timeout when sending rest (post or get) request? Is there any example for that?
  • The proper way to set the timeout on Resteasy client with timeouts. We have an application running in JBoss EAP 7.1.0, and need to make a REST-based API call to another system. I am unable to find a way to set the connect timeout and read timeout using this approach.
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

Client client = ClientBuilder.newBuilder().build();

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content