<div>Hi all,</div>
<div> </div>
<div>I still have a performance issue with my HttpClient. My HttpClient (similar to snoop example) needs to concurrently send multiple requests to some online servers and then wait for all responses come back and then merge them.</div>
<div> </div>
<div>So I provided an answer as <font size="2">LinkedBlockingQueue in my response handler. When messageReceived got invoked via an event, it offers the response in answer.</font></div>
<div>I also provided a getContent() method in my response handler for my HttpClient to use to retrieve response of each request.</div>
<div>In getContent(), it uses answer.poll(TIME_OUT, TimeUnit.MILLISECONDS) to get the response offered in messageReceived().</div>
<div> </div>
<div>I created a simulator, a servlet, as an online server. I purposely delay 200 ms in the servlet before returning response. However, it appeared that TIME_OUT in getContent() needed to be pretty long, like 600 ms (or sometimes 1 sec) before getting the response offered by messageReceived().</div>
<div> </div>
<div>Anyone has any idea why it takes so long for messageReceived() being triggered. The Tomcat server is sitting in the same machine where I run my HttpClient. Well, actually Tomcat server is running in my Windows and the HttpClient is running in my VMware in the same machine. It shouldn't be any network impact.</div>
<div> </div>
<div>Is there anything I can do to have messageReceived() invoked reasonably prompt after channel sends a request to the servlet? This seems to be the bottleneck.</div>
<div>This scenario can be just simplified as a simple request to a local server to retrieve a simple, but 200ms-delayed, response. I wish my messageReceived can be triggered within a second.</div>
<div> </div>
<div>Thanks for your help,</div>
<div>Jason</div>