Hi, You can consider to use the seda endpoint instead of direct endpoint in your consumeReadyQueue route. Then the transaction should be committed when the exchange is routed to seda endpoint.
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Friday, December 7, 2012 at 5:55 AM, erstanl wrote: > Here is the use case. > > 1) Consume message from ActiveMQ queue > 2) Update database with data derived from step 1 > 3) Download rather large data from database > 4) Process data from step 3 > 5) Update database with results from step 4 > > These routes represent that case (I think): > > Steps 1, 2 > <route id="consumeReadyQueue"> > <from uri="q:queue:queue/batch/ready" /> > <transacted/> > <to uri="bean:batchListener?method=init" /> > <to uri="direct:processBatch" /> > </route> > > Steps 3, 4, 5 > <route id="processBatch"> > <from uri="direct:processBatch" /> > <to uri="bean:batchProcessor?method=process" /> > </route> > > The problem is, I only want steps 1 and 2 (route: consumeReadyQueue) to > participate in the XA transaction. From what I have gleaned, > consumeReadyQueue forces processBatch to participate in the transaction. > This is not good for my case as processBatch can take up to 30 seconds. Is > there a way to force the commit to happen before processBatch is running? > > Maybe I am approaching this wrong. What are my possible options? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/transactions-that-span-multiple-routes-tp5723735.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).