Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 20737 invoked from network); 22 Jul 2010 10:31:02 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jul 2010 10:31:02 -0000 Received: (qmail 92373 invoked by uid 500); 22 Jul 2010 10:31:02 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 92085 invoked by uid 500); 22 Jul 2010 10:30:59 -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 92077 invoked by uid 99); 22 Jul 2010 10:30:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jul 2010 10:30:58 +0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 74.125.82.173 as permitted sender) Received: from [74.125.82.173] (HELO mail-wy0-f173.google.com) (74.125.82.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jul 2010 10:30:52 +0000 Received: by wyi11 with SMTP id 11so346068wyi.32 for ; Thu, 22 Jul 2010 03:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=gdGKW3ymS//dxoVpwrfSn+YYRZbc1iK8QKTZdohv5+M=; b=M0yzOXtFUD9V3CO8ybaa0VIlTAES2UcGKhXScPXE7WXyTz3rxGd/lvYBt7Npb6LbPS MO+mc84hJJJfEuSi8btO5xV+p3DGhsFGGg7+5bwKS9X/Qnh5zwb1XLs/9XLFjD+A94Nz ZdBkBbBlpRsX05sk24S94DF7j0TyFsFrANpR8= 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=oPc7J4UlZhugOUw/yNRJ9LiM7pbOoFyy3b6D+eV8Pz383ulkxDZXKlvQzIs4DSOwvM iU/4Yyx75JwpUSbVdGuewF58hE7O4IS5wDTjIKn+CUdgMGOMi0nEEHPPoJsyDKWPG5BH n8prLjwU1Oc2/fWqqF27ryXc/iBc7bxi3v//s= Received: by 10.227.138.69 with SMTP id z5mr1693897wbt.15.1279794632319; Thu, 22 Jul 2010 03:30:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.221.40 with HTTP; Thu, 22 Jul 2010 03:30:12 -0700 (PDT) In-Reply-To: <1279794246293-1835181.post@n5.nabble.com> References: <1279794246293-1835181.post@n5.nabble.com> From: Claus Ibsen Date: Thu, 22 Jul 2010 12:30:12 +0200 Message-ID: Subject: Re: Exception in the DeadLetterChannel causes message to be consumed 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 Hi See this wiki page when asking for help. http://camel.apache.org/support.html See the first bullet! Camel has 15+ released version so its hard to bother helping if you don't report the version being used. And if you have tried newer releases etc. On Thu, Jul 22, 2010 at 12:24 PM, kumaap wrote: > > My scenario. > > consuming a message off a JMS queue and an exception happens, the message= is > routed to my DeadLetterChannel where it executes my custom failureProcess= or > which fails and throws an exception > im finding that the exception just gets swallowed and the message gets > consumed of the queue. > > > Method > > RedeliveryErrorHandler.deliverToFailureProcessor > > try { > =A0 =A0 =A0 =A0// store the last to endpoint as the failure endpoint > =A0 =A0 =A0 =A0exchange.setProperty(Exchange.FAILURE_ENDPOINT, > exchange.getProperty(Exchange.TO_ENDPOINT)); > =A0 =A0 =A0 =A0processor.process(exchange); > } catch (Exception e) { > =A0 =A0 =A0 =A0exchange.setException(e); <--- sets the new exception > } > > then just carries on and ignores the exception and resets > > Method > RedeliveryErrorHandler.prepareExchangeAfterFailure > > ExchangeHelper.setFailureHandled(exchange); > > =A0 =A0 =A0 =A0// honor if already set a handling > boolean alreadySet =3D exchange.getProperty(Exchange.ERRORHANDLER_HANDLED= ) !=3D > null; > if (alreadySet) { > =A0 =A0 =A0 =A0boolean handled =3D exchange.getProperty(Exchange.ERRORHAN= DLER_HANDLED, > Boolean.class); > =A0 =A0 =A0 =A0if (log.isDebugEnabled()) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0log.debug("This exchange has already been = marked for handling: " + > handled); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0if (handled) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0exchange.setException(null); > =A0 =A0 =A0 =A0} else { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// exception not handled, put exception ba= ck in the exchange > > exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT, > Exception.class)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// and put failure endpoint back as well > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0exchange.setProperty(Exchange.FAILURE_ENDP= OINT, > exchange.getProperty(Exchange.TO_ENDPOINT)); > =A0 =A0 =A0 =A0} > return; > > > What i want it to do is try and use the failureProcessor if that fails th= row > a Rutime exception and let camel reprocess the mesage. > > -- > View this message in context: http://camel.465427.n5.nabble.com/Exception= -in-the-DeadLetterChannel-causes-message-to-be-consumed-tp1835181p1835181.h= tml > Sent from the Camel - Users mailing list archive at Nabble.com. > --=20 Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus