A good idea is to check the unit test of camel-jms and search for exceptionListener to see how to use this option.
You need to refer to a bean id which it will lookup in the spring xml file. exceptionListener=foo <bean id="foo" class="..."/> On Tue, Dec 14, 2010 at 5:28 AM, Damian Harvey <[email protected]> wrote: > I had an error in a property file with an incorrect queue name that didn't > exist. When the JMS Reply was hit a JMSException was generated "MQJMS2008: > failed to open MQ queue". This is to be expected. What happens is that Camel > goes into an infinite loop trying to process the message. > > I was expecting my onException in the Route would handle it but it did not. I > have tried to add an ExceptionListener that "is to be notified of any > underlying JMS exceptions" however I think I have the syntax wrong. Here is > a simplified version of my route: > > public void configure() throws Exception { > getContext().setHandleFault(true); > > onException(JmsException.class).handled(true).to("jms:SYSTEM.DEAD.LETTER.QUEUE"); > > errorHandler(deadLetterChannel("jms:SYSTEM.DEAD.LETTER.QUEUE")); > > > from("jms:CBS.START?replyTo=CBS.REPLY&exceptionListener=com.aon.camel.exception.ExceptionListener") > .process(new JmsInboundMessageProcessor()) > > .recipientList(simple("${header.requestNode}")).ignoreInvalidEndpoints() > .process(new JmsOutboundMessageProcessor()); > } > > Thanks, > > Damian. > > ________________________________ > > This communication (and any attachments) is directed in confidence to the > addressee(s) listed above, and may not otherwise be distributed, copied or > used. The contents of this communication may also be subject to privilege, > and all rights to that privilege are expressly claimed and not waived. If you > have received this communication in error, please notify us by reply e-mail > or by telephone and delete this communication (and any attachments) without > making a copy. > > Before opening or using attachments, you should check them for viruses and > defects. We do not accept liability in connection with computer virus, data > corruption, delay, interruption, unauthorised access or unauthorised > amendment. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
