camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From majiedahamed <majied.ban...@cognizant.com>
Subject Re: Catch camel exception in java code
Date Wed, 23 Nov 2011 13:18:22 GMT
The camel version is 2.4

1)the original code is 
+++++++++++++++
<onException useOriginalMessage="true">			

<exception>org.apache.camel.processor.validation.SchemaValidationException</exception>

 <exception>org.xml.sax.SAXParseException</exception>	   
 <exception>org.apache.camel.ValidationException</exception>
 
 <exception>java.lang.Exception</exception>		
 <redeliveryPolicy maximumRedeliveries="0" />				
 <handled>
  <constant>true</constant>
 </handled>
  <to
  uri="log:xml? 
level=INFO&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true"
/>
  <to uri="file:{{retry_loc}}" />
  <to uri="bean:myBean"/>
</onException>

2) My class is 

public class MyBean {
	
	public void doSomething(Object body, Exception cause) { 
		cause.printStackTrace();
	}

}

3)Bean decleration is <bean id="myBean" class="MyBean"></bean> 

Please suggest should i use parameter to the below and try ?

<to uri="bean:myBean?methodName=doSomething"/>


--
View this message in context: http://camel.465427.n5.nabble.com/Catch-camel-exception-in-java-code-tp5015714p5016627.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message