camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Re: Transactional Route with JTA
Date Fri, 30 Oct 2015 14:50:56 GMT
Hi Raul,

thanks for the link. I think for the most part I already followed this.

I created my own spring JtaTransactionManager in blueprint though. Not 
sure if this makes a difference. I switched it to use the 
PlatformTransactionManager that aries transaction provides.
Still I get no redelivieries. Any other idea what might be wrong?

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" <chris@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


Mime
View raw message