You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Miso Camel <mi...@yahoo.com> on 2015/11/17 18:27:48 UTC

aggregator not propagating exceptions

Hi All,

Can someone please help me with an exception propagation issue. In the below
Camel config, I can't get the exception raised in the aggregator of the
child route to propagate in the catch block of the parent route. If I remove
the aggregator from the child route, the exception correctly propagates to
the parent. So this proves the aggregator swallows the exception, which is
the issue.

I'd appreciate any ideas.

many thanks,

Miso

<route id="parentRoute">
        <from uri="direct:parentRoute"/>
        <doTry>
                <to uri="direct:childRoute"/>
                <doCatch>
                        <exception>java.lang.Exception</exception>
                        
                        <to uri="bean:..." />
                </doCatch>
        </doTry>
</route>


<route id="childRoute">
        <from uri="direct:childRoute"/>
        <aggregate strategyRef="aggregatorStrategy" completionSize="100">
               
<correlationExpression><constant>"DUMMY"</constant></correlationExpression>
                
                <to uri="sql:insert into TAB (COL1, COL2, COL3) values
(:#COL1, :#COL2, :#COL3)?batch=true" />
        </aggregate>
</route>



--
View this message in context: http://camel.465427.n5.nabble.com/aggregator-not-propagating-exceptions-tp5774000.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: aggregator not propagating exceptions

Posted by Miso Camel <mi...@yahoo.com>.
Sadly the XML comments I put into the post aren't showing. Just to clarify:
It is the sql insert statement in the child route, which may throw an
exception. I would like to catch this exception in the parent's catch block
and pass it on to the bean:... to handle. When I remove the aggregation and
just leave in the sql line, all works as expected and the exception
correctly reaches the parent's catch block.

This works:

<route id="childRoute">
        <from uri="direct:childRoute"/>
        <to uri="sql:insert into TAB (COL1, COL2, COL3) values (:#COL1,
:#COL2, :#COL3)?batch=true" />
</route>



--
View this message in context: http://camel.465427.n5.nabble.com/aggregator-not-propagating-exceptions-tp5774000p5774003.html
Sent from the Camel - Users mailing list archive at Nabble.com.