users@jersey.java.net

[Jersey] Re: AsyncHttpClient

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Sun, 23 Oct 2011 15:32:53 +0200

Hello Ajinkya,

you'll need to add this dependency:

<dependency>
  <groupId>com.sun.jersey.contribs</groupId>
  <artifactId>jersey-non-blocking-client</artifactId>
  <version>1.9.1</version>
</dependency>


then create your client:

  ClientConfig cc = new DefaultNonBlockingClientConfig();
  cc.getProperties().put(NonBlockingClientConfig.PROPERTY_THREADPOOL_SIZE, 10); // default value, feel free to change
  Client c = NonBlockingClient.create(cc);


Non-blocking client is only "implementation detail" - API is still the
same, internal processing is different. You should get significant
performance gain in async heavy use cases (lost of simultaneous requests).

Hope it helps.

Regards,
Pavel

On 10/21/11 1:21 PM, ajinkya prabhune wrote:
> Hi,
>
> I am interested in implementing the AsyncHttpClient which has been
> introduced in Jersey 1.9 could someone
> please provide me the details/tutorial regarding this client and also
> the links.
>
> --
> Thank you and Regards
> Ajinkya Prabhune
>