users@jersey.java.net

Re: [Jersey] Parallel calls via jersey client

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Fri, 22 Oct 2010 09:41:49 +0200

On Oct 22, 2010, at 12:26 AM, varnit wrote:
>
> I couldn't find any documentation on doing multiple parallel
> requests via the
> jersey client. I am looking for something similar to curl multi.
> Does the
> jersey client support this feature?
>

Yes. It is a little obscure.

For client:

https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/Client.html

   "Methods to create instances of WebResource are thread-safe.
Methods that modify configuration and or filters are not
     guaranteed to be thread-safe. "

and for WebResource:

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/WebResource.html

   "Methods to create a request and return a response are thread-safe.
Methods that modify filters are not guaranteed to be
     thread-safe."

Paul.