5

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.

1
  • 1. no. You can debug this issue further by setting the read timeout for jersey http client like so: Client client = ClientBuilder.newClient(); client.property(ClientProperties.READ_TIMEOUT, 100); // in milliseconds Commented Feb 8, 2017 at 20:33

0

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.