Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 59576 invoked from network); 26 Aug 2009 07:14:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Aug 2009 07:14:10 -0000 Received: (qmail 6691 invoked by uid 500); 26 Aug 2009 07:14:10 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 6636 invoked by uid 500); 26 Aug 2009 07:14:09 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 6622 invoked by uid 99); 26 Aug 2009 07:14:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2009 07:14:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.216 as permitted sender) Received: from [209.85.220.216] (HELO mail-fx0-f216.google.com) (209.85.220.216) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2009 07:13:59 +0000 Received: by fxm12 with SMTP id 12so2784996fxm.20 for ; Wed, 26 Aug 2009 00:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=Yb6VP9ZScOhdiREncb/kX5Lpx74TYGdwWi1GN4Ob2KU=; b=eMqvKs8Dai5AEc3ko4Qbq1YMfQpr7OzuizI9Cr5LO/Vc+0Yo6jtUWTqYmWI9afNWIr xqdV1bT2qgQPSJiZ/nOC2fhYrmH5zhcRAWSYbvk6Cjel06oTmdJX7lzmKrzRqnlpXgSO 6mSHA1fRH9HzFY2yAWK31NSn2Uc5g9hG951no= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=QnlLS8kglDNii5fuWWZv4svALvcuXqcpWJ7KCXlZ+l9DjIFnR9vAPr2wKab9SGJRi5 XCgE6DsKZmS00i7X+7I8Sm+T/apDTrw5qf5L/PTyCbBpw1H5uJ2M2jJoH4GPU68+zuiB sI9U6ZQ4PIJ/3+Y2bNh/k1spujYpIaal2/lH4= MIME-Version: 1.0 Received: by 10.204.23.11 with SMTP id p11mr1577756bkb.29.1251270818158; Wed, 26 Aug 2009 00:13:38 -0700 (PDT) In-Reply-To: <25147696.post@talk.nabble.com> References: <25139892.post@talk.nabble.com> <25140543.post@talk.nabble.com> <4A948F79.80201@gmail.com> <25147696.post@talk.nabble.com> From: Claus Ibsen Date: Wed, 26 Aug 2009 09:13:18 +0200 Message-ID: <5380c69c0908260013v6d1a8483n7da9ca7cf98b55d0@mail.gmail.com> Subject: Re: Changing retry handler for http component To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Aug 26, 2009 at 9:07 AM, Srivatsa Katta wrot= e: > > Hi, > > I did try using the httpClientConfigurerRef option on http component, but= it > doesn't seem to pick up the given implementation. > > My route looks like this. > > from("http://myhost:8080?throwExceptionOnFailure=3Dfalse&httpClientConfig= urerRef=3DhttpClientConfigurer" > > And I have a bean declared in spring context xml like this.. > > class=3D"org.xyz.core.transport.camel.DefaultHttpClientConfigurer" /> > > The DefaultHttpClientConfigurer looks like this.. > > =A0public void configureHttpClient(HttpClient client) { > =A0 =A0 =A0 =A0DefaultHttpMethodRetryHandler retryhandler =3D new > DefaultHttpMethodRetryHandler(0, false); > =A0 =A0 =A0 =A0client.getParams().setParameter(HttpMethodParams.RETRY_HAN= DLER, > retryhandler); > =A0 =A0 =A0 =A0client.getParams().setSoTimeout(1000); > =A0 =A0} > > Is there anything else am missing ?? Try debugging or do some system out in your class to see whether it is invo= ked. BTW Which Camel version are you using? > > Cheers! > Katta > > > > willem.jiang wrote: >> >> Yeah, you already find the answer yourself. >> Here is the example[1] that you may need :) >> >> [1] >> https://svn.apache.org/repos/asf/camel/trunk/components/camel-http/src/m= ain/java/org/apache/camel/component/http/BasicAuthenticationHttpClientConfi= gurer.java >> >> Willem >> >> Srivatsa Katta wrote: >>> Oh I believe httpClientConfigurerRef option can be used.. will give it = a >>> shot.. >>> >>> >>> >>> Srivatsa Katta wrote: >>>> Hi, >>>> >>>> Am using http component and the route looks something like this. >>>> >>>> from("direct:client").to("http://myhost:8080/? >>>> throwExceptionOnFailure=3Dfalse"); >>>> >>>> If the server is down/not reachable, the http component does retry for= 3 >>>> times (as observed from the logs) and then throws up the connection ti= me >>>> out exception. >>>> >>>> Yes there is a way to set timeout option on http component, but how do= I >>>> set a custom http client retry handler. If I had to do this for common= s >>>> http client programaticaly, it can be done like shown below >>>> >>>> httpclient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, ne= w >>>> DefaultHttpMethodRetryHandler(0, false)); >>>> >>>> How do I do this configuration for http component in camel ?? >>>> >>>> One way I could think of as described in http component documentation, >>>> override the httpComponent settings in the spring.xml by setting param= s, >>>> connection manager etc. Was just wondering is there any simpler way ?? >>>> >>>> Any help appreciated. >>>> >>>> Cheers!! >>>> Katta >>>> >>>> >>>> >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/Changing-retry-handle= r-for-http-component-tp25139892p25147696.html > Sent from the Camel - Users mailing list archive at Nabble.com. > > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus