Return-Path: Delivered-To: apmail-activemq-camel-user-archive@locus.apache.org Received: (qmail 73648 invoked from network); 6 Dec 2008 12:10:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2008 12:10:20 -0000 Received: (qmail 88313 invoked by uid 500); 6 Dec 2008 12:10:32 -0000 Delivered-To: apmail-activemq-camel-user-archive@activemq.apache.org Received: (qmail 88297 invoked by uid 500); 6 Dec 2008 12:10:32 -0000 Mailing-List: contact camel-user-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: camel-user@activemq.apache.org Delivered-To: mailing list camel-user@activemq.apache.org Received: (qmail 88286 invoked by uid 99); 6 Dec 2008 12:10:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Dec 2008 04:10:32 -0800 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ramon.buckland@gmail.com designates 64.233.170.185 as permitted sender) Received: from [64.233.170.185] (HELO rn-out-0910.google.com) (64.233.170.185) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Dec 2008 12:09:02 +0000 Received: by rn-out-0910.google.com with SMTP id j67so517761rne.21 for ; Sat, 06 Dec 2008 04:09:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type:references :x-google-sender-auth; bh=zzNrI/qNdyugjt1VP3dKx2zsA84bBJmbKgahGurvtek=; b=LbEjRlna93WT6j6vlSEgZDKmwxc6QFbyHN7fKX7GNa9VZWfJLdapdlQkhaYIbQ0lZL DMAHvT651hb4UfX6+L7MvgFhv2si2gy78BTqyxhDML4TAKg59uj7Z7vZtxa366iopgCy civYQ6KLhPA7Il+pQFvVWtTQiZq35Yy52exS0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:references:x-google-sender-auth; b=gHSEBO3HY/VSyxk3Gv3zDchZzxbI7A8SvCe6rLg+qP3A4ST084XXfmqerlghuIQYmE Q86h3DFhwiO5ahKm1BWxiN9gy1w0NbaWy5EQs/sJZqepAHUB8tWaRkCvtryXtk7fmUgh j5ZHxIodgbrbS8SCD5N9/gVmZG6FjIj5q5Rm4= Received: by 10.151.145.21 with SMTP id x21mr3701842ybn.150.1228565380819; Sat, 06 Dec 2008 04:09:40 -0800 (PST) Received: by 10.150.158.17 with HTTP; Sat, 6 Dec 2008 04:09:40 -0800 (PST) Message-ID: <509899e80812060409s1f4fd1cye8a35d815ed8b31a@mail.gmail.com> Date: Sat, 6 Dec 2008 23:09:40 +1100 From: "Ramon Buckland" Sender: ramon.buckland@gmail.com To: camel-user@activemq.apache.org Subject: Re: Attempting to capture Exception from properties using In-Reply-To: <5380c69c0812060357x202571e4mb98fb1ba3491208c@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_23710_13465218.1228565380798" References: <509899e80812060347y15723fe9icb2f7aea6d20f82f@mail.gmail.com> <5380c69c0812060357x202571e4mb98fb1ba3491208c@mail.gmail.com> X-Google-Sender-Auth: 42e2abb6818dfbb6 X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_23710_13465218.1228565380798 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks Claus, Sorry, I should not have been so lazy to not look at the source. Thank you on the comment of the route, (as you can imagine - it is not even the half of the routes :-) That worked beautifully .. here is a sample of the real email fired out to gmail :-) Subject: system job status : unexpected fail : job-execute-1 An Unexpected error occured. Please review the logs for more details. {{{ internal.mycompany.megasystem.CustomException: Failed whilst scanning [some/directory/foo/bar] }}} On Sat, Dec 6, 2008 at 22:57, Claus Ibsen wrote: > Hi > > That is a beautiful route, quite clever I must say. > > About el. I looked into it's unittest in camel-juel > In JuelLanguageTest it doesn't have a properties test. > > Instead of ${in} you should use ${exchange} as the properties is on this > object. > > > ${exchange.properties['CamelCauseException']} > > Would be nice with this properties add to the unit test of the el language. > > > > /Claus Ibsen > Apache Camel Committer > Blog: http://davsclaus.blogspot.com/ > > > > On Sat, Dec 6, 2008 at 12:47 PM, Ramon Buckland > wrote: > > Hi All, > > > > I have come across something unusual which I am hoping someone can shed > some > > light on. > > > > I am currently testing failure paths of some routes, and as part of the > > "reporting" of a failure, I need to send an email. > > > > I have a catch all onException config in the route .. > > > > > > java.lang.Exception > > > > > > > > FAIL > > > > > > > > Which is designed to perform two tasks, > > (a) forward the "exception" details out to an email > > (b) respond with FAIL back to the "caller" > > > > (b) is working nicely. > > > > For (a), the direct:exceptionEmail looks as follows > > > > > > > > > > > > > uri="log:internal.company.ExceptionFailure?level=INFO&showAll=true"/> > > FAIL - System Status - An > > Exception was caught > > > > > > An unexpected error occured. Please review the logs for more > > details. > > ${in.properties['CamelCauseException']} > > > > > > > > > > > > > > The problem I am seeing is that the attempting to capture the > exception > > details is saying there is no "properties" > > > > DEBUG Pipeline - Message exchange has failed so > > breaking out of pipeline: Exchange[Message: execute-job-1] exception: > > javax.el.PropertyNotFoundException: The class > > 'org.apache.camel.impl.DefaultMessage' does not have the property > > 'properties'. fault: null > > > > This is well and good, (I can see via the source that, indeed, > > org.apache.camel.impl.DefaultMessage does not have a getProperties .. > etc) > > however, the log which is running before, shows the message does actually > > have Properties, and the property I am after (CamelCauseException). > > > > INFO ExceptionFailure - > > Exchange[Id:ID-itasca/50862-1228562841594/0-1, > > > Properties:{org.apache.camel.processor.DeadLetterChannel.FAILURE_HANDLED=internal.company.MyException: > > MyException details, org.apache.camel.bean.BeanHolder=bean: aBean, > > CamelCauseException=internal.company.MyException: MyException details}, > > Headers:{org.apache.camel.RedeliveryCounter=0 ... --SNIP Headers-- }, > > BodyType:String, Body:execute-job-1, Out: null] > > > > Where is the disconnect occuring ? Can Juel () get to the Properties > of > > a message ? > > > > I can see that Ognl (http://activemq.apache.org/camel/ognl.html) has the > > properties exposed (so I might just switch) but if there is a bug, or > some > > impl to do, let me know and I can dive in to this one. > > > > regards > > Ramon > > > ------=_Part_23710_13465218.1228565380798--