Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3A653E203 for ; Wed, 19 Dec 2012 05:05:26 +0000 (UTC) Received: (qmail 55869 invoked by uid 500); 19 Dec 2012 05:05:25 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 55714 invoked by uid 500); 19 Dec 2012 05:05:24 -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 55084 invoked by uid 99); 19 Dec 2012 05:05:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 05:05:22 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 209.85.210.49 as permitted sender) Received: from [209.85.210.49] (HELO mail-da0-f49.google.com) (209.85.210.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Dec 2012 05:05:16 +0000 Received: by mail-da0-f49.google.com with SMTP id v40so706523dad.22 for ; Tue, 18 Dec 2012 21:04:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:message-id:in-reply-to:references:subject :x-mailer:mime-version:content-type:content-transfer-encoding :content-disposition; bh=beNX2lTSGNdyBvXclGsF+8PvRAeXnjMNnghr7uLDY2g=; b=nTi6j84mH7lzo6XFb5gZ0u6pE+/QzVUB+VaQKSs3nKW/9yBDGB9UkXZcsqkRrpHkhK m4BLFSy7SSOnnlg1CwSaQevK12ZOFgl0gh0F+TlrCMxZBTjdwVnctb/pl6JOsWUCe7sD ddysdtbvKM8q4629HilTpfHZ7IAhaURmortnYRnfD7V//PiclN/GFjgctf4ijysE/r5K edrH7qJoN1TOCvk1x46mqirr7QVSLcrz+eBDp6XPuPvR5183bUjDwgM2uyfzl6a19RIv gHwlkAH0l4bvKtHtWaBi6zAbutWTIGStfcTFOqoFRWmg/xAtNFVth6TTLZHiu5S3q+Rj go+w== X-Received: by 10.66.80.70 with SMTP id p6mr13788479pax.23.1355893495176; Tue, 18 Dec 2012 21:04:55 -0800 (PST) Received: from [192.168.1.135] ([125.33.124.176]) by mx.google.com with ESMTPS id kn3sm2413894pbc.3.2012.12.18.21.04.51 (version=SSLv3 cipher=OTHER); Tue, 18 Dec 2012 21:04:54 -0800 (PST) Date: Wed, 19 Dec 2012 13:04:47 +0800 From: Willem jiang To: users@camel.apache.org Message-ID: <47189430CD474415B18516EADDEB3987@gmail.com> In-Reply-To: <1355853294502-5724296.post@n5.nabble.com> References: <1355853294502-5724296.post@n5.nabble.com> Subject: Re: global onException only works for first to() route item but nothing after that X-Mailer: sparrow 1.6.4 (build 1176) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org I just added an unit test=5B1=5D according to your description, I cannot = reproduce the error Please check it out and do some modify to see if you can reproduce the er= ror. =5B1=5Dhttp://svn.apache.org/viewvc=3Frev=3D1423761&view=3Drev =20 -- =20 Willem Jiang Red Hat, Inc. =46useSource is now part of Red Hat Web: http://www.fusesource.com =7C http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) = (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On Wednesday, December 19, 2012 at 1:54 AM, semiosis wrote: > Hi all, > =20 > =46irst thank you for camel, it has been a huge help streamlining our > workflows. I'm having trouble with a global exception handler and would= > appreciate any help or ideas you have. > =20 > I have a global onException set up before my route, like this... > =20 > onException(Exception.class).handled(false).to(=22bean:exceptionHandler= =22) > .logStackTrace(true); > =20 > Then I have a route which goes from an aws-sqs consumer to a chain of b= eans, > like this... > =20 > from(sqsUri + sqsAuth) > .unmarshal(json) > .to(=22bean:checkin=22) > .choice() > .when(body().contains( > ProcessA.class.getSimpleName())) > .pipeline(=22bean:stepA1=22, > =22bean:stepA2=22, > =22bean:stepA3=22) > .when(body().contains( > ProcessB.class.getSimpleName())) > .pipeline(=22bean:stepB1=22, > =22bean:stepB2=22, > =22bean:stepB3=22) > .when(body().contains(Checkin.DUPLICATE)) > .to(=22bean:duplicateHandler=22).otherwise() > .to(=22bean:exceptionHandler=22); > =20 > If an exception is thrown in =22bean:checkin=22 my exceptionHandler is = invoked > and everything is good. The problem is that if an exception is thrown i= n > any bean after =22bean:checkin=22 it is silently ignored, not handled b= y the > global onException. > =20 > I've tried everything I can think of to reduce the complexity here. Eve= n a > simple two-step route behaves the same... > =20 > from(sqsUri + sqsAuth) > .unmarshal(json) > .to(=22bean:checkin=22) > .to(=22bean:duplicateHandler=22); > =20 > If an exception is thrown in =22bean:duplicateHandler=22 it's silently = ignored, > so it's not an issue with the choice() or pipeline()s. > =20 > It seems that if an exception is thrown anywhere after the first to() t= hen > my global onException is not invoked. > =20 > I've spent two days working on this and I'm out of ideas. What am I doi= ng > wrong=3F Please help. > =20 > Thank you very much, > =20 > -louis > =20 > =20 > =20 > -- > View this message in context: http://camel.465427.n5.nabble.com/global-= onException-only-works-for-first-to-route-item-but-nothing-after-that-tp5= 724296.html > Sent from the Camel - Users mailing list archive at Nabble.com (http://= Nabble.com).