I use apache http client v4.5 and use it as a REST client. In some cases, I recognize the "[read] I / O error: Read timed out" error, which comes from the httpclient infrastructure when it reads the received content and displays it as the last message.
This does not seem to affect, but I wonder if anyone has an idea where it comes from and how it can be solved. According to the following chain ( link ), there seems to be a problem with the "mutlithreaded" configuration.
However, I only use the default http client configuration, and while I am using version v4, I donβt know how I can set multithreading to false to see if it matters.
I also tried to set timeouts, but that did not help.
Any clues?
Log:
15:48:05.984 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "HTTP/1.1 200 OK[\r][\n]" 15:48:05.984 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Date: Tue, 29 Dec 2015 14:48:03 GMT[\r][\n]" 15:48:05.984 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Server: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8[\r][\n]" 15:48:05.984 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "X-Powered-By: PHP/5.6.8[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Cache-Control: nocache, private[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Content-Length: 99[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Keep-Alive: timeout=5, max=99[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Connection: Keep-Alive[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "Content-Type: application/json[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "[\r][\n]" 15:48:05.985 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "{"success":true,"data":{"id":1946,"location":"http:\/\/localhost:9001\/shop\/api\/articles\/1946"}}" 15:48:06.016 [main] DEBUG org.apache.http.wire - http-outgoing-8 << "[read] I/O error: Read timed out"
my Http client initialization
HttpClientBuilder httpBuilder = HttpClientBuilder.create(); // set timeout did not helped // RequestConfig.Builder requestBuilder = RequestConfig.custom(); // requestBuilder = requestBuilder.setConnectTimeout(timeout); // requestBuilder = requestBuilder.setConnectionRequestTimeout(timeout); // requestBuilder = requestBuilder.setSocketTimeout(timeout); // httpBuilder.setDefaultRequestConfig(requestBuilder.build()); HttpClient httpClient = httpBuilder.build();
megloff
source share