camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard Ligny <bernard.li...@gmail.com>
Subject Conditional route-scoped onException
Date Mon, 29 Apr 2013 10:18:09 GMT
I am trying to model the following logic for the error handling of one single
specific route.

1. Post a (large) xml document
2. If the post failed, then split original xml into into n smaller
documents, and repost them (step 1) individually.

That kind of recursive process needs of course a stopping condition (size of
batch > 1)


<route id="processBatch">
            <from uri="activemq:queue:solr-batches"/>
            <choice>
            	<when>
            		<simple>${headers.batch_size} &gt; 1</simple>
            		<onException>
		            	<exception>java.lang.Exception</exception>
		            	<handled><constant>true</constant></handled>      
     	
		            	<to uri="direct:splitAndResubmit"/>
            		</onException>
            	</when>
            </choice>            
            <to uri="http:..."/>  
</route>

According to the my observations, it seems the uri "direct:splitAndResubmit"
is *always* called. 

So the question is: is this allowed to have such logic, i mean a
<onException> inside a <choice> 
- or should it always directly follow a <from> element ?

Thx,

Bernard.




--
View this message in context: http://camel.465427.n5.nabble.com/Conditional-route-scoped-onException-tp5731725.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message