users@jersey.java.net

Re: [Jersey] Asynchronous POST with jersey client ?

From: jfarcand <jfarcand.oss_at_gmail.com>
Date: Fri, 23 Jul 2010 16:57:21 -0400

Salut,

On 10-07-20 5:15 PM, Pavel Bucek wrote:
> Hello Morten,
>
> async client requests are possible, please take a look at
> AsyncHttpMethodTest [1], it should be exactly what you are looking for.

Except this method use a thread under the hood to fake asynchronous if
I'm not mistaken, hence consuming resources (one thread per request). I
did some experimental integration works on integrating the Async Http
Client library

   http://github.com/ning/async-http-client

on branch
>
https://jersey.dev.java.net/source/browse/jersey/branches/jersey_asynchttpclient/

but this is experimental and will need some re-work on some Jersey core
classes to make it work properly.

A+

-- Jeanfrancois



>
> Don't hesitate to ask if you have some other question.
>
> Regards,
> Pavel
>
> [1]
> https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/jersey-tests/src/test/java/com/sun/jersey/impl/client/AsyncHttpMethodTest.java?rev=3252&view=markup
>
>
> On 7/20/10 8:39 PM, Morten wrote:
>> Normally, jersey client blocks until the receiver responds... Is there
>> a way where I can instead perform an asynchronous POST using Jersey
>> client where code that sends the request does not wait for the
>> response to arrive before continuing, ignores any response and also
>> does not take up system resources while the receiver might take its
>> time to process the POST operation ?
>>
>> I need this for a notification API where the server should not block
>> resources regardless of what clients do.
>>
>> Cheers,
>> Morten
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>