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.