The Bookrepository uses Aries JPA. The class is marked @Transactional. So it will start an XA transaction before each call or join one.

For the camel route that start with jms: the JMSComponent is injected with a PlatformTransactionManager. This causes camel to start a transaction before receiving each message and commit or rollback when the route is finished. I also used the transacted() dsl which starts a (required) transaction but I am not sure if it is needed.

In any case the log I pasted shows that the XA transaction really happens (at least I hope so).

Christian


On 30.10.2015 20:58, Clebert Suconic wrote:
What is the actual code doing XA? I look at the examples and I
couldn't pinpoint one.

On Fri, Oct 30, 2015 at 3:33 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
I am currently doing a demo for XA transactions that should show how to
combine JMS and JPA in one transaction.

My code is at:
https://github.com/Talend/tesb-rt-se/tree/ebook-example/examples/tesb/ebook

I am pretty sure my setup for the XA Transactions is correct now. In my logs
I see that JMS participates in the transaction and that the transaction is
rolled back.
See
https://gist.github.com/cschneider/f44d5ea729379a6e19f7

I would expect that now ActiveMQ redelivers the message 3 times like I set
it up. This does not seem to work though. For each redelivery I should get
an exception and the rollback in camel but I only see it once.

This is my setup for the ConnectionFactory:
https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-connectionfactory/src/main/resources/OSGI-INF/blueprint/blueprint.xml

and this is my camel setup :
https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/resources/OSGI-INF/blueprint/blueprint.xml

Any idea what I am doing wrong?

Christian


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com





--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to