Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 34744 invoked from network); 27 May 2009 14:51:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 May 2009 14:51:25 -0000 Received: (qmail 15507 invoked by uid 500); 27 May 2009 14:51:37 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 15484 invoked by uid 500); 27 May 2009 14:51:37 -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 15474 invoked by uid 99); 27 May 2009 14:51:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 14:51:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.220.177 as permitted sender) Received: from [209.85.220.177] (HELO mail-fx0-f177.google.com) (209.85.220.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 14:51:25 +0000 Received: by fxm25 with SMTP id 25so4530039fxm.20 for ; Wed, 27 May 2009 07:51:05 -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=D9aLtWPOCgnSTB1OXRjSx15itYoNJF6Fa8I+bjInbDQ=; b=eXRQrO9/Dxd5IXQTn/cYeIaIjx1MxHPgjCnZIxgOzeUe6MnFfe/yK9FCKAsiGXAKpY lfPxl625AxL//cMhljtr7cpKS/g1NEaexPDf9SzVvcWC7K9lniuNzoygRE7JUylsRQnl Yxd3ZkbCyoVFZbCGgweZQpAX25X/vTSDkHxzY= 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=JKXUfjTe2PCM6H3E29cuTZqu3p9+CJXO41Ko7fSiyOBNWOPtMZg8ScJVulqrE50ks3 FRZZSiPqj4n+5W5XLQ6y8vbDl1op+jz5XOR2ytTlraUvLT+h57DvAfr6nrLbqMoFtgLa Bhq4Qokl5Moft7Qhg2I9hvksTc7zrhVgZC6G0= MIME-Version: 1.0 Received: by 10.223.108.196 with SMTP id g4mr121242fap.36.1243435864609; Wed, 27 May 2009 07:51:04 -0700 (PDT) In-Reply-To: <23743717.post@talk.nabble.com> References: <23743717.post@talk.nabble.com> From: Claus Ibsen Date: Wed, 27 May 2009 16:50:43 +0200 Message-ID: <5380c69c0905270750t8611a37g4ba4eca129118180@mail.gmail.com> Subject: Re: Exception, ErrorHandler and redelivery To: users@camel.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi Yeah error handling and redelivery is hard. 1) onRedelivery is *only* executed when Camel performs a redelivery attempt. That is it retries processing some exchange that failed last time. 2) onException will by default not do any redelivery attempts, unless you set a maximumRedelivers option >=3D 1. So in your first attempt Camel will by the onException catch the RuntimeException and *not do any redeliveries* as maximumRedelivers is by default =3D 0 for onException. So when you change the maximumRedeliveries =3D 1 then the onRedelivery processor kicks in as expected. onRedelivery is meant to allow you to do a bit of custom message adjustment before Camel retries. And yes it can also be used for logging. On Wed, May 27, 2009 at 4:32 PM, mta38 wro= te: > > Hi all, > > I play with Exception, ErrorHandler and redelivery (Camel 2.0-M1) and the= re > are some things =A0that I can't understand :confused:. > > snippet code > > class=3D"org.apache.camel.builder.DeadLetterChannelBuilder"> > =A0 =A0 =A0 =A0 value=3D"direct:response"/> > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 class=3D"org.apache.camel.processor.RedeliveryPolicy"> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > xmlns=3D"http://camel.apache.org/schema/spring"> > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0java.lang.Runti= meException > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= true > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > > =85 other routes =85 > > > > routeRedelivery bean is a processor which make some trace =A0in a log fil= e. > > When I raise a runtimeException, the process method of routeRedelivery be= an > is not called. I can't understand why, since onRedelivery property is > defined for my global dead letter channel. > > If I modify onException element like following: > > > > java.lang.RuntimeException > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0true > =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 > > > > And I raised a RuntimeException, I have some trace in my log file that > proves that process method of routeRedelivery bean is called. > > Is someone can explain me why onRedelivery processor is not called when i= t's > defined in global scope will be appreciated. > Best regards, > Mta38 > > -- > View this message in context: http://www.nabble.com/Exception%2C-ErrorHan= dler-and-redelivery-tp23743717p23743717.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