javax.ws.rs.ProcessingException: java.net.SocketTimeoutException - Jersey Client

8.2k Views Asked by At

I am attempting to read a REST web service response in a client and it works fine for individual calls. While doing the load test (~5000 calls in 5 minutes) for same web service call, I am getting socket read time out error.

The bigger problem is, the socket time error actually happens after a web service response is successfully received (checked via wireshark) (may be jersey client is confused).

Earlier I was using Jersey client 1.x, now tried the same with Jersey client 2.x and still we see the error.

I have checked most of the read timeout examples in stack overflow and couldn't find an appropriate case

java.net.SocketTimeoutException: Read timed out under tomcat fix java.net.SocketTimeoutException: Read timed out

java.net.SocketTimeoutException: Read timed out under tomcat

I am getting the following error

javax.ws.rs.ProcessingException: java.net.SocketTimeoutException: Read timed out at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287

Just wanted to confirm on few things. Any suggestions will really help me to get directions on debugging the issue.

  1. Is there a possibility in Jersey client to get confused when the volume of API calls are 5000 in a span of 5 minutes. I see socket timeout only that time
  2. I believe if the content-length is mismatched then jersey may wait for the Rest service to send more output. Not sure if that will be the case
  3. The API response time is not a very large one, typically time 7 ~ 10 seconds.

Note : I am not a Java Developer and any help is much appreciated.

0

There are 0 best solutions below