You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by somT <st...@gmail.com> on 2015/04/10 00:22:54 UTC

doTry, doCatch does not work for bean in the Camel Spring DSL

I have the route like below. Looks like the Spring bean ref does not work in
the doTry/doCatch in the Camel Spring DSL. Where as if I make the bean ref
to an individual processor - then it works. Is that a limitation in Camel?
Can any one advise on this?

<route id="My-cron-route" trace="true" >
        <from uri="quartz://report?cron=0+0/2+*+*+*+?" />
            <setHeader
headerName="datasource"><simple>ref:MyRouteDao</simple></setHeader>
            <setHeader
headerName="DEST_DIR"><constant>c:/temp/destination</constant></setHeader>
        <doTry>
            <process ref="MyFileLockGenerator" />
            <choice>
                <when>
                    <simple>${ in.header.MyFileLockAcquired } ==
"true"</simple>
                    <to
uri="bean:MyBeanOperation?method=findAllOutboundFolderList"/>
                    <to
uri="bean:MyBeanOperation?method=getFilteredFilesFromOutboundFolders"/>
                    <to
uri="bean:MyBeanOperation?method=moveFilesToDestinationFolder"/>
                    <to
uri="bean:MyBeanOperation?method=createTriggerFilesInDestinationFolder"/>
                    <to
uri="bean:MyBeanOperation?method=deleteSourceFiles"/>
                    <doCatch>
                        <exception>java.lang.Exception</exception>
                        
                    </doCatch>
                    <doFinally>
                        <to
uri="bean:MyFileLockGenerator?method=releaseExclusiveReadLock()"/>  
                    </doFinally>
                </when>
            </choice>
        </doTry>
    </route>



-----
Somesh
--
View this message in context: http://camel.465427.n5.nabble.com/doTry-doCatch-does-not-work-for-bean-in-the-Camel-Spring-DSL-tp5765549.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: doTry, doCatch does not work for bean in the Camel Spring DSL

Posted by yogu13 <yo...@gmail.com>.
Hello,

You could try enabling the logs for camel and check how the flow progresses.
and post back if any issue

Regards,
-Yogesh



--
View this message in context: http://camel.465427.n5.nabble.com/doTry-doCatch-does-not-work-for-bean-in-the-Camel-Spring-DSL-tp5765549p5765675.html
Sent from the Camel - Users mailing list archive at Nabble.com.