fuseesb - Database transactions between multiple camel routes -
how transactions works in camel routes spring dsl , 1 of route throws exception?
if routeb throws exception, how exception propagated routea.
if exception thrown in routeb, see transactionalerrorhandler
handling exception , rolling transaction.
setting errorhandlerref="noerrorhandler"
on routeb not help.
how can this?
my camel routes definition:
<route id="routea"> <from uri="direct-vm:endpointa" /> <transacted /> <to uri="direct-vm:endpointb" /> <bean ref="beana" method="save" /> <onexception> <exception>java.lang.exception> <handled><constant>true</constant></handled> <bean ref="beana" method="handleerror" /> <rollback markrollbackonly="true" /> </onexception> </route> <route id="routeb"> <from uri="direct-vm:endpointb" /> <throwexception ref="ex"/> </route>
in camel transacted
command wrapper spring transactiontemplate
, in enlist route in transaction supplied platformtransactionmanager
. configuration option on org.apache.camel.spring.spi.springtransactionpolicy
propagation behaviour, handling rollbacks etc must done within transacted route.
in case should catch exception route b, if gets error handler late.
<route id="routea"> <from uri="direct-vm:endpointa" /> <transacted/> <dotry> <to uri="direct-vm:endpointb" /> <docatch> <exception>java.lang.exception</exception> <bean ref="beana" method="handlefail"/> </docatch> <dofinally> <bean ref="beana" method="save" /> </dofinally> </dotry> </route> <route id="routeb"> <from uri="direct-vm:endpointb" /> <throwexception ref="ex"/> </route>
Comments
Post a Comment