You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dunnlow <du...@yahoo.com> on 2014/07/14 23:27:13 UTC

Forcing a transaction to commit (using Spring XML)?

Using camel 10.0.3 with Spring 3.1.  

Doing workflow processing, I have two routes.  One pulls a message from a
JMS queue, processes it and then puts a new message on a different JMS queue
(where the new message continues to be processed).  

I DONT want the processing of the new message (pulled from the second queue)
to impact the original transaction in any way (e.g. the first transaction
shouldn't wait and shouldn't roll back as a result of the second)

I'm using different transaction managers on both JMS queues (since I have
different connection factories / different connection urls).  However, they
are both org.springframework.jms.connection.jmsTransactionManager.

I have the transaction policy on the 2nd route as PROPAGATION_REQUIRES_NEW,
but the first transaction doesn't get commited if there is an issue in the
secondary processing.  I want it to be commited as soon as it successfully
places the new message on the second queue.

What is the correct way to implement this (in Spring XML)?

Here is the gist of my routes:

<route id="firstQueue">
   <from uri"activemqMain:queue:inBound?concurrentConsumers=10" />
   <transacted ref="PROPAGATION_REQUIRES_NEW"/>
   <bean ref="myBean" method="doProcessing" />
   <to uri="activemqMainProducer:queue:stepTwo" />
</route>

<route id="stepTwoQueue">
   <from uri"activemqMain:queue:stepTwo?concurrentConsumers=10" />
   <transacted ref="PROPAGATION_REQUIRES_NEW"/>
   <bean ref="myBean" method="doStepTwoProcessing" />
   <to uri="direct:doStepThreeProcessing"/>
</route>




--
View this message in context: http://camel.465427.n5.nabble.com/Forcing-a-transaction-to-commit-using-Spring-XML-tp5753808.html
Sent from the Camel - Users mailing list archive at Nabble.com.