Jersey Client - Apache HTTP Client 4.x integration

Since this week, Jersey users can benefit from Apache HTTP Client 4.x integration. "jersey-apache-http-client4" module has been finalized and provides similar functionality as "jersey-apache-http-client", but make sure you read javadoc - most of settings have changes because of major change in Apache HTTP Client API.

How to start with Jersey and Apache HTTP Client 4.x?

Add following dependency:

<dependency>
    <groupId>com.sun.jersey.contribs</groupId>
    <artifactId>jersey-apache-http-client4</artifactId>
    <version>1.7-SNAPSHOT</version> <!-- or 1.7-ea04 and newer, when available -->
</dependency>


And you can instantiate new client for example like described in Javadoc: package com.sun.jersey.client.apache4.

Comments:

Thanks for the update, now its possible to use the client4 features like (HTTP) caching which is a good performance boost. The issue that I'm having is that the 1.7 impl. does not support HTTPS (or at least I cannot get it to work). It seems that the getHost() method in ApacheHttpClient4Handler does not take the scheme into account thus always creating an HttpHost using HTTP. Best Regards, Kalle

Posted by guest on June 08, 2011 at 09:55 AM CEST #

Yeah, you are right. Fixed in the trunk, updated version will be available on Friday (1.8-ea03) and in all future releases (1.8 should be released in late June). Thanks for report and for the evaluation!

Posted by Pavel on June 08, 2011 at 11:02 AM CEST #

I am trying to figure out how to submit a problem report for jersey-client-apache4. When we switched our Discovery Services SALs to use the jersey-client-apache4, we found that the client.setReadTimeout() method didn't have any apparent effect. Can you assist in getting this reported to Jersey?

Posted by guest on May 23, 2012 at 04:51 AM CEST #

You can use users@jersey.java.net mailing list or file new issue in Jersey JIRA: http://java.net/jira/browse/JERSEY. Thanks!

Posted by Pavel on May 23, 2012 at 09:19 AM CEST #

I'm also facing the same problem -client.setReadTimeout() does not seem to be working with Apache4.

Posted by guest on September 25, 2012 at 08:14 PM CEST #

Iam also facing the similar problem after porting to jersey-apache4.
Connect Timeout and Read Timeout not working.

Appriciate for any help.

Posted by Satyam on May 06, 2013 at 02:06 PM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Pavel Bucek

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today