Thanks Andy, We' using 3.3.2 release, I will definitely try your suggestion.
On Thu, Jul 25, 2019 at 2:11 PM Andy McCright <[email protected]> wrote: > Hi Anfernee, > > What version of CXF are you using? The connectTimeout and readTimeout > methods were added to the ClientBuilder class in JAX-RS 2.1 (which should > be in 3.2.X and 3.3.X streams). If possible, it is probably better to use > the JAX-RS APIs rather than the CXF-specific properties. For example: > > Client client = ClientBuilder.connectTimeout( connectTimeout, > TimeUnit.SECONDS ).readTimeout( readTimeout, TimeUnit.SECONDS > ).newClient(); > > Hope this helps, > > Andy > > On Thu, Jul 25, 2019 at 7:24 PM Anfernee Xu <[email protected]> wrote: > > > Hello, > > > > I'm trying to set connectionTimeout and readTimeout on rs client powered > by > > cxf, but it didn't work, > > I'm assume the properties for connectionTimeout and readTimeout is > > > > org.apache.cxf.jaxrs.client.spec.ClientImpl#HTTP_CONNECTION_TIMEOUT_PROP > > org.apache.cxf.jaxrs.client.spec.ClientImpl#HTTP_RECEIVE_TIMEOUT_PROP > > > > here's my code, really appreciated on your help > > > > import javax.ws.rs.client.Client; > > import javax.ws.rs.client.ClientBuilder; > > > > final Client client = ClientBuilder.newClient(); > > // > > per > > org.apache.cxf.jaxrs.client.spec.ClientImpl#HTTP_CONNECTION_TIMEOUT_PROP > > client.property("http.connection.timeout", connectTimeout); > > // per > > org.apache.cxf.jaxrs.client.spec.ClientImpl#HTTP_RECEIVE_TIMEOUT_PROP > > client.property("http.receive.timeout", (int) readTimeout); > > > > > > > > -- > > --Anfernee > > > -- --Anfernee
