I have now added more logging and see that I indeed have a JTA transaction and it seems to include the receive of the jms message. I also see that the transaction is rolled back when the error happens. So the only thing missing seems to be the redelivery. Any idea why that can happen?

Christian

On 30.10.2015 15:37, Raul Kripalani wrote:
Hi Christian,

You need to plug in the JTA TransactionManager into the JMS consumer, so
that the transaction is opened as part of the consumption.

Otherwise, the transaction starts after the route kicks off and therefore
doesn't cover the JMS consumption itself.

Maybe this resource helps:
https://access.redhat.com/documentation/en-US/Fuse_ESB_Enterprise/7.0/html/EIP_Transactions_Guide/XaJms-Overview.html

Raúl.
On 30 Oct 2015 14:31, "Christian Schneider" <ch...@die-schneider.net> wrote:

I am trying to set up a route that spans an XA transaction from a jms
endpoint to a db based endpoint or to another JMS endpoint.

If I do a route like this:
from("jms:queue1").transacted().to("jms:queue2")

Will the transaction then also include the receive of the JMS message?

I have set up an example at:
https://github.com/Talend/tesb-rt-se/tree/ebook-example/examples/tesb/ebook

The route is at

https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/java/org/talend/esb/examples/ebook/importer/ImportRoutes.java
and the blueprint is here

https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-importer/src/main/resources/OSGI-INF/blueprint/blueprint.xml

I have implemented the BookRepository using Aries JPA and it supports XA
transactions. For the test I throw an exception if the book title is
"error1".
I see the exception in camel but the message does not seem to be returned
to the broker and I see no redelivery.

I configured the ConnectionFactory like this:

https://github.com/Talend/tesb-rt-se/blob/ebook-example/examples/tesb/ebook/ebook-connectionfactory/src/main/resources/OSGI-INF/blueprint/blueprint.xml

Any idea what I am doing wrong? Or do I misunderstand the concept of
transactional routes in camel and this simply can not work?
Can I debug the transaction handling somehow?

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