Stop reading http response
Hi, In case of 200 (or any other return code), I'd like to be able to not read headers body because I simply don't care as it's not an error and I want to avoid fill memory with the content. Is there any was to do that? (with non async or async) Thanks, -- Olivier Lamy Ecetera: http://ecetera.com.au http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Internal change with last 4.2.3 with URI ?
Hi Folks, recently Maven Wagon upgraded to last 4.2.3 client. Now url containing '_' doesn't work anymore. Exception says : java.lang.IllegalArgumentException: Host name may not be null at org.apache.http.HttpHost.init(HttpHost.java:79) Url have format: https://foo_bar.online.com; When testing: URI uri = new URI(https://foo_bar.online.com;); String host = uri.getHost(); host is null so I understand the complain :-). Is there any related change to use URI ? Do I have any workaround ? Thanks -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Http Get retrieve data larger than Integer.MAX_VALUE
2013/1/28 Oleg Kalnichevski ol...@apache.org: On Mon, 2013-01-28 at 23:42 +0100, Olivier Lamy wrote: Hi, Is there any way to retrieve a file which is larger than Integer.MAX_VALUE ? ContentLengthInputStream has a cast which can be bigger than Integer.MAX_VALUE if (pos + len contentLength) { len = (int) (contentLength - pos); } Thanks, -- Olivier Lamy Olivier This applies to one read operation only (unless I am missing something). I believe byte arrays in Java physically cannot be larger than Integer.MAX_VALUE. One can read content entities larger than Integer.MAX_VALUE in multiple chunks, though. arghh correct :-) Oleg - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
SSLv3 support
Hi, Is there any way to handle SSLv3 (see related maven issue https://jira.codehaus.org/browse/MNG-5363 ) ? Or what is the best way to achieve that ? Thanks for any advice -- Olivier Lamy Talend: http://coders.talend.com http://twitter.com/olamy | http://linkedin.com/in/olamy - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Retry on ConnectTimeoutException
Hi, Sure, I will. If I want to provide a patch do I have to do it on the 4.0.x branch or trunk ? Thanks, -- Olivier 2010/1/6 Oleg Kalnichevski ol...@apache.org: Olivier Lamy wrote: Sure. It's just I found this more elegant/readable code using the retry handler mechanism rather than writing catch/loop as with http client 3.x. While I agree with Ken that retrying requests on ConnectTimeoutException feels wrong, it is certainly incorrect that retry handler is not called. Feel free to open a JIRA for this issue. Oleg -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: On Jan 6, 2010, at 12:49pm, Olivier Lamy wrote: NO. ConnectionTimeOutException can means the target endPoint cannot be contacted. My software POST some datas to various systems : company ones and externals one. Sometimes some systems are on small maintenance mode or during a restart time or some other stuffs. What I like is to not failed directly the application and try some retries with a sleep period between. Having long delays deep in the bowels of the request handling code feels wrong. If you need long sleep periods, then I'd wrap the entire POSTing process with a catch/retry loop, versus trying to leverage some retry support inside of HttpClient. -- Ken With this I can give a chance to the target systems to be live before : shutdown my application, having a kind of system alarm which will wake some folks (including probably myself) maybe during the nigth. All of this only because someone has restarted a server somewhere without any notifications. IMHO it's a good use case :-)) -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: From my experience, you get a ConnectTimeoutException when you've made a configuration or implementation mistake. E.g. - your connection pool size isn't big enough given the number of simultaneous threaded requests. - you're not releasing connections properly (e.g. when aborting a request) So having an auto-retry is kind of odd here - if you want to avoid the timeout, fix the root problem. -- Ken On Jan 6, 2010, at 12:27pm, Olivier Lamy wrote: Thanks for reply. Yes I already use this for this type of exception. But this doesn't catch the ConnectionTimeOut. -- Olivier 2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com: Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read timeout or Connection reset or Stream close exceptions . and Read timeout exception is the most one. How do you use HttpRequestRetryHandler to handle Read timeout exception ? I use this code ,but again i got this Read timeout exception , GetMethod httpGet = new GetMethod(url); httpGet.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true)); Is there another way to handle this exception? Khosro. From: Olivier Lamy ol...@apache.org To: httpclient-users@hc.apache.org Sent: Wed, January 6, 2010 10:08:21 AM Subject: Retry on ConnectTimeoutException Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail: mailto:httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: mailto:httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier
Re: Retry on ConnectTimeoutException
HTTPCLIENT-902. Fix and junit included. So I haven't touched the interface HttpRequestRetryHandler. which says : boolean retryRequest(IOException exception, int executionCount, HttpContext context); As ConnectTimeoutException extends InterruptedIOException, I have overrid IOException.getCause() to return ConnectTimeoutException Thanks, -- Olivier 2010/1/7 Oleg Kalnichevski ol...@apache.org: On Thu, 2010-01-07 at 11:14 +0100, Olivier Lamy wrote: Hi, Sure, I will. If I want to provide a patch do I have to do it on the 4.0.x branch or trunk ? Thanks, -- Olivier Trunk. Oleg - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Retry on ConnectTimeoutException
Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Retry on ConnectTimeoutException
Thanks for reply. Yes I already use this for this type of exception. But this doesn't catch the ConnectionTimeOut. -- Olivier 2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com: Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read timeout or Connection reset or Stream close exceptions . and Read timeout exception is the most one. How do you use HttpRequestRetryHandler to handle Read timeout exception ? I use this code ,but again i got this Read timeout exception , GetMethod httpGet = new GetMethod(url); httpGet.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true)); Is there another way to handle this exception? Khosro. From: Olivier Lamy ol...@apache.org To: httpclient-users@hc.apache.org Sent: Wed, January 6, 2010 10:08:21 AM Subject: Retry on ConnectTimeoutException Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail: mailto:httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: mailto:httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Retry on ConnectTimeoutException
NO. ConnectionTimeOutException can means the target endPoint cannot be contacted. My software POST some datas to various systems : company ones and externals one. Sometimes some systems are on small maintenance mode or during a restart time or some other stuffs. What I like is to not failed directly the application and try some retries with a sleep period between. With this I can give a chance to the target systems to be live before : shutdown my application, having a kind of system alarm which will wake some folks (including probably myself) maybe during the nigth. All of this only because someone has restarted a server somewhere without any notifications. IMHO it's a good use case :-)) -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: From my experience, you get a ConnectTimeoutException when you've made a configuration or implementation mistake. E.g. - your connection pool size isn't big enough given the number of simultaneous threaded requests. - you're not releasing connections properly (e.g. when aborting a request) So having an auto-retry is kind of odd here - if you want to avoid the timeout, fix the root problem. -- Ken On Jan 6, 2010, at 12:27pm, Olivier Lamy wrote: Thanks for reply. Yes I already use this for this type of exception. But this doesn't catch the ConnectionTimeOut. -- Olivier 2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com: Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read timeout or Connection reset or Stream close exceptions . and Read timeout exception is the most one. How do you use HttpRequestRetryHandler to handle Read timeout exception ? I use this code ,but again i got this Read timeout exception , GetMethod httpGet = new GetMethod(url); httpGet.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true)); Is there another way to handle this exception? Khosro. From: Olivier Lamy ol...@apache.org To: httpclient-users@hc.apache.org Sent: Wed, January 6, 2010 10:08:21 AM Subject: Retry on ConnectTimeoutException Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail: mailto:httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: mailto:httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Retry on ConnectTimeoutException
Sure. It's just I found this more elegant/readable code using the retry handler mechanism rather than writing catch/loop as with http client 3.x. -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: On Jan 6, 2010, at 12:49pm, Olivier Lamy wrote: NO. ConnectionTimeOutException can means the target endPoint cannot be contacted. My software POST some datas to various systems : company ones and externals one. Sometimes some systems are on small maintenance mode or during a restart time or some other stuffs. What I like is to not failed directly the application and try some retries with a sleep period between. Having long delays deep in the bowels of the request handling code feels wrong. If you need long sleep periods, then I'd wrap the entire POSTing process with a catch/retry loop, versus trying to leverage some retry support inside of HttpClient. -- Ken With this I can give a chance to the target systems to be live before : shutdown my application, having a kind of system alarm which will wake some folks (including probably myself) maybe during the nigth. All of this only because someone has restarted a server somewhere without any notifications. IMHO it's a good use case :-)) -- Olivier 2010/1/6 Ken Krugler kkrugler_li...@transpac.com: From my experience, you get a ConnectTimeoutException when you've made a configuration or implementation mistake. E.g. - your connection pool size isn't big enough given the number of simultaneous threaded requests. - you're not releasing connections properly (e.g. when aborting a request) So having an auto-retry is kind of odd here - if you want to avoid the timeout, fix the root problem. -- Ken On Jan 6, 2010, at 12:27pm, Olivier Lamy wrote: Thanks for reply. Yes I already use this for this type of exception. But this doesn't catch the ConnectionTimeOut. -- Olivier 2010/1/6 Khosro Asgharifard khosro_quest...@yahoo.com: Hi all, Olivier , Maybe i could not answer your question but i have one question . Sometimes i got the Read timeout or Connection reset or Stream close exceptions . and Read timeout exception is the most one. How do you use HttpRequestRetryHandler to handle Read timeout exception ? I use this code ,but again i got this Read timeout exception , GetMethod httpGet = new GetMethod(url); httpGet.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(10, true)); Is there another way to handle this exception? Khosro. From: Olivier Lamy ol...@apache.org To: httpclient-users@hc.apache.org Sent: Wed, January 6, 2010 10:08:21 AM Subject: Retry on ConnectTimeoutException Hi, I'm using http-client 4.0.1. Is there any way to use HttpRequestRetryHandler to handle retry on ConnectTimeoutException ? (I did it with http client 3 ) Thanks, -- Olivier - To unsubscribe, e-mail: mailto:httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: mailto:httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org Ken Krugler +1 530-210-6378 http://bixolabs.com e l a s t i c w e b m i n i n g - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
is HTTPCLIENT-841 really fixed ?
Hi Folks, I have added a comment and attached a jvm error pid. Is there any know issue regarding deadlock issue with the final 4.0 ? (with heavy load). Thanks -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: is HTTPCLIENT-841 really fixed ?
Yes I see that look to be already logged : http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6865265. -- Olivier 2009/9/11 Oleg Kalnichevski ol...@apache.org: On Fri, Sep 11, 2009 at 05:15:31PM +0200, Olivier Lamy wrote: It was new stuff we introduced in new version which break under heavy load. So I have to search somewhere else :-(. Thanks for your time, -- Olivier Olivier I would look into upgrading / downgrading the JVM first # # An unexpected error has been detected by Java Runtime Environment: # # Internal Error (sharedRuntime.cpp:461), pid=21886, tid=20 # Error: guarantee(false,missing exception handler) # # Java VM: Java HotSpot(TM) Server VM (10.0-b19 mixed mode solaris-sparc) # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # sharedRuntime.cpp:461 smells like a trouble to me Oleg 2009/9/11 Oleg Kalnichevski ol...@apache.org: On Fri, Sep 11, 2009 at 04:29:20PM +0200, Olivier Lamy wrote: Hi Folks, I have added a comment and attached a jvm error pid. Is there any know issue regarding deadlock issue with the final 4.0 ? (with heavy load). Thanks -- Olivier Olivier, Yes, I am prerry certian the issue has been resolved. There are no known / reported issues with HttpClient 4.0 stability. Oleg - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org -- Olivier - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Re: Self-signed certs and a replacement for EasySSLProtocolSocketFactory
Hi, You can have a look at the continuum code which do this with httpclient 4.x. [1] Line with comment : // https scheme schemeRegistry.register( new Scheme( https, new EasySSLSocketFactory(), 443 ) ); HTH, -- Olivier [1] https://svn.apache.org/repos/asf/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/project/builder/AbstractContinuumProjectBuilder.java 2009/2/10 Will McQueen willmcqu...@yahoo.com: Hi, For testing in stage environment, I'm using EasySSLProtocolSocketFactory to create an SSL Socket that accept self-signed certificates. But HttpClient 3.1 docs say that this method is deprecated. Is there a replacement class (either in HttpClient 3.1 or 4.0) that achieves the same goal? Thank you. Cheers, Will - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org - To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org
Exception Unable to establish route. (with a custom ssl socket factory)
Hi, I'm trying to write a custom ssl socket to handle self signed certificates). I have the following exception : Caused by: java.lang.IllegalStateException: Unable to establish route. planned = HttpRoute[{}-https://localhost:443] current = HttpRoute[{s}-https://localhost:443] Any ideas ? Thanks, -- Olivier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Aggregate javadoc on the site and Url Validator
2008/8/23 Oleg Kalnichevski [EMAIL PROTECTED]: On Sat, 2008-08-23 at 00:06 +0200, Olivier Lamy wrote: Hi, Is there any plan to published an aggregated javadoc [1] with the next release ? (currently it's hard to naviguate in all modules or I haven't found it :-) in the site ). That would be quite handy, but it is too late for this release. Anyways, we happily accept patches ;-) Yes sure I know :-) Second question : is there class which can validate my url (as boolean validate(String url) ) ? And is there a class to extract username/password from url with the format : https://[username:password@]host Standard j.n.URI should do the trick boolean validURL; try { URI uri = new URI(https://username:[EMAIL PROTECTED]); System.out.println(uri.getUserInfo()); validURL = true; } catch (URISyntaxException ex) { validURL = false; } stdout username:password My bad it's so simple :-) Thanks, -- Olivier Hope this helps Oleg Thanks, -- Olivier [1] http://maven.apache.org/plugins/maven-javadoc-plugin/examples/aggregate.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Aggregate javadoc on the site and Url Validator
Hi, Is there any plan to published an aggregated javadoc [1] with the next release ? (currently it's hard to naviguate in all modules or I haven't found it :-) in the site ). Second question : is there class which can validate my url (as boolean validate(String url) ) ? And is there a class to extract username/password from url with the format : https://[username:password@]host Thanks, -- Olivier [1] http://maven.apache.org/plugins/maven-javadoc-plugin/examples/aggregate.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]