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.
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.
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.
Marked as answered I have started a separate thread on the use of Spring & Apache Camel with Sonic MQ