Camel schema allows onException block in the split element

Solution Unverified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content