mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Genender <jgenen...@apache.org>
Subject Re: Asynchronous Http Client donation
Date Sat, 18 Aug 2007 15:32:23 GMT


Simon Aquilina wrote:
> Hi,
> 
> I am sorry if this reply is not exactly what you may be expecting back.
> I am sure around here there are many experts that will have many more
> interesting replies then this one. However could you please explain to
> me (and possible others) what Asynch[ronous] Http Client is, and what
> are its advantages? If I know exactly what it is then I can imagine ways
> on how to use it :)

Sure...I would be happy to explain it.

With the movement of web containers to NIO (Ex. Jetty, Tomcat, and
AsyncWeb), they are able to handle a lot more throughput and
simultaneous connections.

For some web applications, the servlets may need to retrieve data from a
third party web service or scrape 3rd party HTML to embed in a page, or
need to grab content as a proxy, like images or ads or pdf from another
server.  In these sorts of scenarios, the NIO/Comet in the web server
would normally have a thread that is blocking when using a blocking
client API (like Commons HttpClient or Sun's HttpURLConnect) to retrieve
this data.  This could significantly throttle the throughput of the NIO
containers.  By having an Async Http Client API, the thread could be
parked and put into use for something else while the original call is
waiting for a connection or a response from the third party server.

Jeff

> 
> Thanks and Regards,
> Sim085
> 
>> From: Jeff Genender <jgenender@apache.org>
>> Reply-To: jgenender@apache.org
>> To: dev@mina.apache.org
>> Subject: Asynchronous Http Client donation
>> Date: Fri, 17 Aug 2007 20:19:07 -0600
>>
>> Hi,
>>
>> First, I want to say that I am a big fan of Mina.  For those who don't
>> know me (which is everyone), I am a committer on Geronimo and have had
>> several people ask about an async http client API to use with our NIO
>> clients with comet for the 2.0 Geronimo server.  We have had folks who
>> want to be able to do HTTP calls to 3rd party servers from servlets/web
>> apps to get content, and not tie up a thread while its doing its thing.
>>  So I decided to try to whip together an API that was similar to Commons
>> HttpClient, fully asynchronous, but based on Mina...and I think I have
>> 80-90% of it completed.  It is here:
>>
>> http://svn.apache.org/repos/asf/geronimo/sandbox/AsyncHttpClient
>>
>> For what it's worth...it doesn't seem appropriate for Geronimo. So I
>> would like to donate it to Mina.  Please have a look at it and give me
>> feed back for if I have gone down the right path.  It can be enhanced
>> greatly as this is just a start, but I think it can be very useful and
>> become a powerful API with everyone moving to NIO.
>>
>> Don't hold back any comments ;-)  I would really like to see an API like
>> this and I believe Mina is just perfect for this.
>>
>> Please let me know what you think..and if you don't think its right for
>> Mina..thats ok too ;-)  But getting your feedback would be best for
>> me...and making this a community project is even better ;-)
>>
>> Jeff
> 
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.com/

Mime
View raw message