Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 62255 invoked from network); 4 Aug 2009 09:50:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Aug 2009 09:50:20 -0000 Received: (qmail 65530 invoked by uid 500); 4 Aug 2009 09:50:25 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 65468 invoked by uid 500); 4 Aug 2009 09:50:25 -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 65458 invoked by uid 99); 4 Aug 2009 09:50:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 09:50:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Aug 2009 09:50:15 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1MYGeY-0007TK-9s for users@camel.apache.org; Tue, 04 Aug 2009 02:49:54 -0700 Message-ID: <24805472.post@talk.nabble.com> Date: Tue, 4 Aug 2009 02:49:54 -0700 (PDT) From: juhasiltanen To: users@camel.apache.org Subject: Re: Routing with RouteBuilder and onException, missing the Exception instance In-Reply-To: <24804847.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: juhasiltanen@gmail.com References: <24803541.post@talk.nabble.com> <5380c69c0908040107u12075335mca4da141f3d6f700@mail.gmail.com> <24804847.post@talk.nabble.com> X-Virus-Checked: Checked by ClamAV on apache.org As it seems, the exchange can not be sent through a queue for processing after an exception has occured. Upon exception, the control needs to be passed directly to a processor. As I am using spring beans with dependency injections, the route definition needed to be changed from... onException(...).to(queueEndpoint) ... to ... onException(...).beanRef("beanName") ... and the CamelExceptionCaught property is available at the Exchange instance. thanks for your help! -J- juhasiltanen wrote: > > I am trying to get the custom exception at the point when the executions > hits my processor implementation, not during the route configuration. > > I assume, that by invoking Exchange.getProperties a full Map of properties > is provided. Is this the case? > > By iterating over the Map, only two properties are available: CamelBinding > and CamelBeanHolder. > > I am using Camel 2.0 M3 > > Any more ideas? > > -J- > > > Claus Ibsen-2 wrote: >> >> On Tue, Aug 4, 2009 at 9:27 AM, juhasiltanen >> wrote: >>> >>> I have a simple routing configuration of >>> onException(MyException.class).to(myEndpoint) >>> >>> Then I have a simple implementation of a Processor interface reading >>> from >>> myEndpoint (that receives an Exchange), let's call it MyProcessor. >>> >>> How do I get the instance of MyException thrown from the depths of the >>> application to MyProcessor? >>> >>> Exchange.getException returns null, and this is the place I would expect >>> MyException to be found. >> >> No its not as when you do routing in the onException then you handle it. >> You can get the caused exception from a property >> >> In Camel 2.0 >> Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, >> Exception.class); >> >> And its about the same in 1.x the key is different though >> >> See more here: >> http://camel.apache.org/exception-clause.html >> >> In the section "using a processor as failure handler" >> >>> >>> Thank's in advance! >>> -- >>> View this message in context: >>> http://www.nabble.com/Routing-with-RouteBuilder-and-onException%2C-missing-the-Exception-instance-tp24803541p24803541.html >>> Sent from the Camel - Users mailing list archive at Nabble.com. >>> >>> >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> >> > > -- View this message in context: http://www.nabble.com/Routing-with-RouteBuilder-and-onException%2C-missing-the-Exception-instance-tp24803541p24805472.html Sent from the Camel - Users mailing list archive at Nabble.com.