Transactional JMS documentation

paul_inglis.trimble.com's picture
Hi, could someone point me to the documentation detailing transactional JMS usage within the ESB running in standalone mode. I've tried searching for documentation myself but so far have failed to find anything useful. I'm using ESB 2.1.1. Thanks in advance, Paul Inglis
paul_inglis.trimble.com's picture

I've got a little further...

I've managed to get a little further implementing transactional JMS but I'm still stuck.   I've gleaned from various blogs and email trails that I need to add the following entry to my axis2.xml configuration file. <parameter name="transport.Transactionality" locked="false">local</parameter> I'm assuming that the ESB commits should automatically occur when my sequence completes. If an error occurs, I set the following property to force the transaction to rollback instead. <syn:property name="SET_ROLLBACK_ONLY" value="true" scope="axis2"/> Unfortunately, my assumptions are obviously wrong as the transaction never commits and always rollsback.  This causes the ESB to spin at the moment as my JMS queue then immediately delivers the original message back to the ESB. Is there another property I have to set in axis2.xml to configure commiting or do I need to set another property in synapse.xml to get the ESB to commit successfully. Paul Inglis
paul_inglis.trimble.com's picture

i'm now pretty certain that there's a bug here somewhere

I think there is a bug in the method 'handleMessage' in the class 'ServiceTaskMananager' in the axis2-transport-jms-1.0.0 project. The method attempts to following:   1. forward the message to a jmsMessageReceiver for handling.   2. closes the consumer.   3. commits or rollsback the transaction depending on whether jmsMessageReceiver was successfully or not. The problem is with the closing of the consumer.  When i attempt to mimic this action using a test harness using swiftMQ 2.1 (a very old JMS 1.0 queue), closing the consumer also rollbacks the current transaction. Hence the problem i'm seeing.  The current commit or rollback is always being done on an empty transactions and the real transaction is always rolledback. If i change my test harness such that the consumer is closed after the transaction is committed, everything works. I'm not sure who's at fault here though.  It could be that my queue is wrong.  Difficult to tell.  I've briefly looked at the JMS spec and it didn't appear obvious to me what the correct ordering should be. Can this be fixed on WSO2's end? Paul Inglis  
rajika's picture

hi Paul, The JMS transport

hi Paul, The JMS transport ships with the WSO2 ESB fully support distributed and local JMS transaction. It's true that documentation related to this area is lack. I have written some use case of WSO2 ESB with relate to JMS local and distributed tranaction in my personal web log. http://rajikak.blogspot.com/search/label/JMs%20transaction I am in the process of writing a complete documentation which describes the JMS transaction support in our JMS transport. Hope the above link is useful for the moment. Just let me know how it goes. Thanks, Rajika
rajika's picture

hi Paul, Yes you are correct

hi Paul, Yes you are correct about the property which set the transaction to rollback. I have a posted a sample in my personal web log. You can refer that for more information. Rajika
paul_inglis.trimble.com's picture

thanks

Thanks Rajika, I've read through your blog and I'm happy that what I'm doing is correct but the ESB doesn't work until I apply the following patch to the ServiceTaskManager. Paul Inglis
rajika's picture

hi Paul, Nice you got it

hi Paul, Nice you got it working, I was also reading the JMS spec. 1.1 and didn't come across anything related to this. Any way I found this sample which close the session and the consumer once the transaction is committed/rollback. Would you like to submit this patch to WS-Commons project at http://ws.apache.org/commons/transport/ ? Thanks, Rajika
paul_inglis.trimble.com's picture

submitted

I've created issue 'WSCOMMONS-524' for this bug. Paul Inglis
rajika's picture

Paul, Thanks for the

Paul, Thanks for the contribution. Rajika
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)