What's the difference between commons-httpclient and org.apache.httpcomponents

2015-07-07 Thread bit1...@163.com
Hi, httpclient users, I have following maven dependencies, I would ask a question about the difference between commons-httpclient and org.apache.httpcomponents. Although they are both related with HttpClient, but it eems that they are totally difference http client modules. Thanks. common

Re: What's the difference between commons-httpclient and org.apache.httpcomponents

2015-07-07 Thread Francois-Xavier Bonnet
Hi, commons-httpclient is an old version that is not maintained anymore. It is the ancestor of httpcomponents. More explanations here: http://hc.apache.org/httpclient-3.x/ 2015-07-07 12:24 GMT+02:00 bit1...@163.com : > Hi, httpclient users, > I have following maven dependencies, I would ask a qu

Re: Re: What's the difference between commons-httpclient and org.apache.httpcomponents

2015-07-07 Thread bit1...@163.com
I understand , thank you, Francois. bit1...@163.com From: Francois-Xavier Bonnet Date: 2015-07-07 18:34 To: HttpClient User Discussion Subject: Re: What's the difference between commons-httpclient and org.apache.httpcomponents Hi, commons-httpclient is an old version that is not maintained

Re: RE: There are known problems of running HttpClient in a web application?

2015-07-07 Thread bit1...@163.com
Hi Emiliano and all, I encounter this problem also, I am using a junit test that issuing http requests, like following. I would ask where we can see the httpclient log after setting these system properties. @Test public void testHttpClientPool() throws Exception { System.setProperty("org.a

httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
I have following http client code(HttpUtils and HttpClientManager)with HttpClient 4.3.6, and a httpclient code in 3.1, and a test case as well. I observed that HttpClient 4.3.6 is very much slowly than HttpClient 3.1 code. In HttpClient 4.3.6 version code, there are a lot socket time out error(

Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
Can someone kindly help me on this? Thanks a lot! bit1...@163.com From: bit1...@163.com Date: 2015-07-07 20:51 To: httpclient-users Subject: httpclient4 is extremely slow than correpsoning code of HttpClient3 I have following http client code(HttpUtils and HttpClientManager)with HttpClient

Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Stefan Magnus Landrø
You shouldn't close http client on every request, only response Sendt fra min iPhone > Den 7. jul. 2015 kl. 16.05 skrev "bit1...@163.com" : > > > Can someone kindly help me on this? Thanks a lot! > > > > > bit1...@163.com > > From: bit1...@163.com > Date: 2015-07-07 20:51 > To: httpclient-

Re:Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Todd
Thanks Stefan for the reply. Could you please point to me which code you are referring to? At 2015-07-07 22:49:28, "Stefan Magnus Landrø" wrote: >You shouldn't close http client on every request, only response > >Sendt fra min iPhone > >> Den 7. jul. 2015 kl. 16.05 skrev "bit1...@163.com" : >>

Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Stefan Magnus Landrø
>> try{ >> CloseableHttpClient httpclient = Try with resources will close client Sendt fra min iPhone > Den 7. jul. 2015 kl. 16.59 skrev Todd : > > Thanks Stefan for the reply. Could you please point to me which code you are > referring to? > > > > At 2015-07-07 22:49:28, "Stefan Magnus L

Re:Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Todd
Hi, Can someone help review the code? Thanks very much! bit1...@163.com" wrote: > >Can someone kindly help me on this? Thanks a lot! > > > > >bit1...@163.com > >From: bit1...@163.com >Date: 2015-07-07 20:51 >To: httpclient-users >Subject: httpclient4 is extremely slow than correpsoning code

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
Thanks Stefan for the reply. Do you mean that I move the CloseableHttpClient out of the try block like following, public String execute(HttpGet httpGet) { String body = ""; CloseableHttpClient httpclient = this.getHttpclient(); try{ CloseableHttpResponse response = httpclient.execute(httpG

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
One more thing that I noticed is: When I constructing the CloseableHttpClient, response time gets back to normal if I don't pass the PoolingHttpClientConnectionManager object to the HttpClientBuilder HttpClientBuilder httpClientBuilder = HttpClients.custom(); /*comment this code so th

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Alexey Panchenko
AFAIK there is no need in creating a new HttpClient instance every time, it should be created once and reused. On Wed, Jul 8, 2015 at 9:29 AM, bit1...@163.com wrote: > One more thing that I noticed is: > > When I constructing the CloseableHttpClient, response time gets back to > normal if I don'

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
Thanks Alexey for the apply。 I tried it, and sorry that it still doesn't work. I am using one thread to sending http request for 1000 times every 20 milliseconds. Some response time are as follows: As you can see, the response time is not stable at all, (there are ocurrences with 7~10 seconds).

Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Stefan Magnus Landrø
Can you create a github repo with your code? Reviewing gets easier then Sendt fra min iPhone > Den 8. jul. 2015 kl. 06.03 skrev "bit1...@163.com" : > > Thanks Alexey for the apply。 I tried it, and sorry that it still doesn't > work. I am using one thread to sending http request for 1000 times e

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
Ok, thanks Stefan! The github repo is https://github.com/bit1129/bit-repo . That are 5 java files there with the discription (Http Client 3.x and Http Client 4.3.6 problematic code) Thanks very much for you guys's time on this!! bit1...@163.com From: Stefan Magnus Landrø Date: 2015-07-08

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread Alexey Panchenko
I would suggest going further and creating 2 buildable projects with maven poms. So one can easily run it. On Jul 8, 2015 11:57 AM, "bit1...@163.com" wrote: > Ok, thanks Stefan! > > The github repo is https://github.com/bit1129/bit-repo . That are 5 java > files there with the discription (Http C

Re: Re: httpclient4 is extremely slow than correpsoning code of HttpClient3

2015-07-07 Thread bit1...@163.com
Thanks Alexey for your suggestion. I have created a maven project and it is here : https://github.com/bit1129/bit-repo/tree/master/HttpClientUsage Thanks! bit1...@163.com From: Alexey Panchenko Date: 2015-07-08 14:05 To: HttpClient User Discussion Subject: Re: Re: httpclient4 is extremely