I have the code below to call the REST API method using the Apache HTTP client. However, only two concurrent requests can be sent using the above client. Is there any parameter for setting max connections?
HttpPost post = new HttpPost(resourcePath); addPayloadJsonString(payload, post);//set a String Entity setAuthHeader(post);// set Authorization: Basic header try { return httpClient.execute(post); } catch (IOException e) { String errorMsg = "Error while executing POST statement"; log.error(errorMsg, e); throw new RestClientException(errorMsg, e); }
The boxes I use are below
org.apache.httpcomponents.httpclient_4.3.5.jar org.apache.httpcomponents.httpcore_4.3.2.jar
Udara SS Liyanage
source share