Executor.execute() is very slow [message #1803083] |
Fri, 22 February 2019 06:26 |
Santhosh Nullipady Messages: 1 Registered: February 2019 |
Junior Member |
|
|
Hi - In our project we are using Apache http client and fluent jar to the hit AWS cloud endpoint where in we pass request and get the response back. Code snippet is given below. But the performance is very slow. Connection establishing and socket read takes more time. Can you please suggest if there is any way to optimize this?
Executor executor = Executor.newInstance(httpClient);
//Executor executor = Executor.newInstance(buildHttpClient());
Response channelResponse = null;
Request httpRequest = Request.Post(serviceEndpointUrl)
.addHeader("Service", wizConnectRequest.getTransCode())
.addHeader("consumer", channel).addHeader("Async", String.valueOf(wizConnectRequest.isAsync()))
.addHeader("TimeOutPeriod", Integer.toString(wizConnectRequest.getTimeOutPeriod()));
channelResponse = executor.execute(httpRequest.useExpectContinue()
.connectTimeout(endPointTimeout) //in milliseconds TODO is it not managed through the Spring???
.bodyString(request, ContentType.DEFAULT_TEXT));
I have attached the performance snapshot using Dynatrace tool where the total time taken is 589.62. Please let me know.
|
|
|
Powered by
FUDForum. Page generated in 0.05266 seconds