0

I'm using Jersey Client in a Java Web App Running on WebSphere Liberty to fetch data located on another server. My web call is an HTTP POST and the data are sent as response. For short amount of data, the response is returned within few seconds, so no problem. The exception is thrown when the request takes a longer time. I notice that after 1 minute java.net.SocketTimeoutException: Read timed out is thrown

I took the same code, an plug it into a public static void main. There, even if the request takes 3 minutes, there is not Timeout. So I guess the issue is not in Jersey, but on some parameter in WebSphere. There is a bunch of parameters define here :

I try to increase few values in server.xml httpOptions: readTimeout, persistTimeout, and persistTimeout to 600 seconds but it doesn't solve the issue. I still get the timeout after 1 minute.

Is there any other parameter which controls this behavior? Best regards,

1
  • Seems unlikely that the jersey client would use sockets managed by any of the configuration options for the HTTP support in WAS. Commented Feb 17, 2016 at 17:51

1 Answer 1

2

I found a solution: it is possible to set different timeout parameters on the client builder before creating the client.

{ 
    ClientBuilder cb =  ClientBuilder.newBuilder()
    cb.property("com.ibm.ws.jaxrs.client.timeout", "600000");   
    cb.property("com.ibm.ws.jaxrs.client.connection.timeout", "100000");    
    cb.property("com.ibm.ws.jaxrs.client.receive.timeout", "600000");    
    Client myclient = cb.build();
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.