users@jersey.java.net

[Jersey] Re: Jersey Client tcp no delay

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Mon, 10 Sep 2012 16:05:49 +0200

Hello Lisa,

Jersey client by default uses HttpUrlConnection from JDK which does not
allow to set tcp no delay option. All you can set is read and connection
timeout, see

http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/config/ClientConfig.html#PROPERTY_CONNECT_TIMEOUT
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/config/ClientConfig.html#PROPERTY_READ_TIMEOUT

You should be able to set tcp no delay when apache http client
integration is used:

http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/params/AllClientPNames.html

(3.x supports it too).

For apache client integration see

http://jersey.java.net/nonav/apidocs/latest/jersey/contribs/jersey-apache-client4/index.html

Feel free to ask if you need more info.

Regards,
Pavel

On 8/31/12 2:52 PM, Cox,Lisa wrote:
>
> Is there a way to set tcp nodelay on the Jersey client?
>
> I am using
>
> import com.sun.jersey.api.client.Client;
>
> Client c = Client.create();
>
> WebResource wr = c.resource(targetURL);
>
> String response =
> wr.path("/someplace").queryParams(parms).get(String.class);
>
> I've been looking all over the place for some ability to set the
> tcpNoDelay on the socket to true...
>
> Thanks much,
>
> Lisa Cox
>
> Database Architect
>
> OCLC, Inc.
>
> 6565 Kilgour Place
>
> Dublin, OH 43017
>