You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by chrajanirao <ra...@gmail.com> on 2008/10/02 02:31:53 UTC

XA transaction with multicast

Hi,

I am trying to make XA transaction work in below example scenario route
defined based on spring xml. I am using camel 1.4.

<camel:route errorHandlerRef="transactionErrorHandler">
	<camel:from uri="timer:is3events?period=30000" />
	<camel:policy ref="PROPAGATION_REQUIRED" />
	<camel:setBody>
		<camel:el>
			select * from events where processed=0 order by id
		</camel:el>
	</camel:setBody>
	<camel:to uri="jdbc:is3DataSource?readSize=1" />
	<camel:multicast>
		<camel:pipeline>
			<camel:process ref="updateEventProcessor" />
			<camel:process ref="myEventProcessor" />
		</camel:pipeline>
		<camel:pipeline>
			<camel:setBody>
				<camel:el>${in.body[0]['MESSAGE']}</camel:el>
			</camel:setBody>
			<camel:to uri="activemq:queue:USERS.xaevents" />
		</camel:pipeline>
	</camel:multicast>
</camel:route>

I have a table called events with id, message and processed columns. I want
to read from this table and send messages to activemq queue and update the
rows with processed=1 in XA transaction. I have this myEventProcessor as a
test processor to throw exception on specific values to simulate failing.

What I noticed is that if we have pipeline with multiple processors under
multicast and if one of those processes fail camel says its breaking out of
pipeline but it does not rollback the transaction. instead, its continuing
with the next pipeline under that multicast. It works fine i.e. rollsback if
the pipeline inside the multicast has only one process in it.

Can someone explain me if this scenario is not supported or if I am doing
something wrong? Any help is greatly appreciated.
-- 
View this message in context: http://www.nabble.com/XA-transaction-with-multicast-tp19771608s22882p19771608.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: XA transaction with multicast

Posted by chrajanirao <ra...@gmail.com>.
Can someone please help?
-- 
View this message in context: http://www.nabble.com/XA-transaction-with-multicast-tp19771608s22882p19801310.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: XA transaction with multicast

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

Could you try with 1.5-SNAPSHOT?

If there is still an issue please report a ticket in JIRA and if possible submit an unit test demonstrating this bug/issue.

Then we are in a much better position to fix it.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: chrajanirao [mailto:rajanicm@gmail.com] 
Sent: 2. oktober 2008 02:32
To: camel-user@activemq.apache.org
Subject: XA transaction with multicast


Hi,

I am trying to make XA transaction work in below example scenario route
defined based on spring xml. I am using camel 1.4.

<camel:route errorHandlerRef="transactionErrorHandler">
	<camel:from uri="timer:is3events?period=30000" />
	<camel:policy ref="PROPAGATION_REQUIRED" />
	<camel:setBody>
		<camel:el>
			select * from events where processed=0 order by id
		</camel:el>
	</camel:setBody>
	<camel:to uri="jdbc:is3DataSource?readSize=1" />
	<camel:multicast>
		<camel:pipeline>
			<camel:process ref="updateEventProcessor" />
			<camel:process ref="myEventProcessor" />
		</camel:pipeline>
		<camel:pipeline>
			<camel:setBody>
				<camel:el>${in.body[0]['MESSAGE']}</camel:el>
			</camel:setBody>
			<camel:to uri="activemq:queue:USERS.xaevents" />
		</camel:pipeline>
	</camel:multicast>
</camel:route>

I have a table called events with id, message and processed columns. I want
to read from this table and send messages to activemq queue and update the
rows with processed=1 in XA transaction. I have this myEventProcessor as a
test processor to throw exception on specific values to simulate failing.

What I noticed is that if we have pipeline with multiple processors under
multicast and if one of those processes fail camel says its breaking out of
pipeline but it does not rollback the transaction. instead, its continuing
with the next pipeline under that multicast. It works fine i.e. rollsback if
the pipeline inside the multicast has only one process in it.

Can someone explain me if this scenario is not supported or if I am doing
something wrong? Any help is greatly appreciated.
-- 
View this message in context: http://www.nabble.com/XA-transaction-with-multicast-tp19771608s22882p19771608.html
Sent from the Camel - Users mailing list archive at Nabble.com.