Camel schema allows onException block in the split element
Issue
It seems that the schema validation allows to write onException block inside the Camel Splitter.
But there is an issue with the processing of the onException block which is executed no matter if there is an exception or not.
Please find below a sample route and the output which demonstrate the behaviour.
Sample route:
<route>
<from uri="timer://foo?repeatCount=1"/>
<setBody>
<constant>1,2,3</constant>
</setBody>
<split>
<tokenize token=","/>
<onException>
<exception>java.lang.Exception</exception>
<handled><constant>false</constant></handled>
<log message="This message should not be logged if there is no exception"/>
</onException>
<log message="Hello World"/>
</split>
</route>
Output:
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | This message should not be logged if there is no exception
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Hello World
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | This message should not be logged if there is no exception
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Hello World
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | This message should not be logged if there is no exception
29 juil. 2013 10:54:25,303 | INFO | Camel (271-camel-39) thread #50 - timer://foo | route1 | 115 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Hello World
Environment
- Fuse ESB 7
- JBoss Fuse 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
