Support for JTA XA Global Transactions

Posted by paulfallowfield on 24-Mar-2011 04:50

Hi,

Does Sonic MQ provides support for JEE compliant XA Global Transactions?

Our scenario is we are looking to use Sonic MQ & SQL Server 2008 R2 and need support for Global Transactions.

As an example we are processing messages off a queue doing some 'stuff' and depositing a new message in a SQL Server database. If an error is encountered at some stage (database connection is lost for example) we currently do handle retries but ultimately if the database connection is not restored within seconds then the source message is lost. This is not an option for us hence the need for Global Transaction support.

Does Sonic MQ provide Global Transaction support? Document references would be useful if possible please.

Alternatively if Sonic MQ does not support this what is the suggested approach?

Many Thanks

Paul.

All Replies

Posted by rrudis on 24-Mar-2011 09:34

SonicMQ does support XA, see Chapter 14 of the MQ Programmers Guide at http://documentation.progress.com/output/Sonic/8.0.1/Docs8.0/books/mq_application_program.pdf.  However, writing your own transaction manager to manage this type of a use case seems a bit ambitious.  I'm curious as to why in the scenario you describe the source message is 'lost' - can use client acknowledge mode to ack the message only after the db insert is successful, and use some type of unique identifier to handle the case where a client failure (e.g. in between db insert and message ack) may result in the message being resent?  Another option to consider is using Sonic ESB in conjunction with the Sonic DB Service.

Posted by paulfallowfield on 30-Mar-2011 10:20

Thanks for your reply,

I neglected to mention we are additionally using Spring and Apache Camel in conjunction with Sonic MQ.

Reading up on this some more Spring provides distributed (global) transaction support and this seems to work although I need to add some aop junit tests to fully prove this.

This javaworld article on transaction handling I found very useful particularly the section on the 'Shared Transaction Resource Pattern' which fits with the scenario of taking messages off a queue, doing some stuff and creating entries in a database.

http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html?page=1
The Spring manual has a chapter on Transactions which gives further detail on how to go about implementing this.
Is this approach (Sonic MQ with Spring & Apache Camel) supported as there is an absence of examples?
I was disappointed that the Sonic MQ examples arent maven projects (The most popular Java Build Tool/Manager) and dont use spring (the most popular Java Framework)
thanks
Paul.

Posted by paulfallowfield on 31-Mar-2011 02:33

Marked as answered I have started a separate thread on the use of Spring & Apache Camel with Sonic MQ

This thread is closed