Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AMQP, SQL Server and XA

Tags:

amqp

xa

we are developing an application with following characteristics:

  • standalone spring 3.1.0.RELEASE application
  • JPA with Hibernate 3.6.7.Final
  • AMQP (RabbitMQ as Server, Spring AMQP as Client)
  • SQL Server 2008 with jTDS driver

We need to synchronize transactions between RabbitMQ and SQL Server, so we are trying to setup XA with atomikos. The problem is that we can´t find a single spring sample configuration file for that situation that actually works. We tried so many combinations using samples from Spring documentation, google, forums, etc. Something is allways missing.

Could someone, please, provide us a such file so we can use it as a starting template for our configuration.

P.S. Do we really need XA?

Thanks.

like image 718
Ivan Bosnic Avatar asked Apr 03 '12 01:04

Ivan Bosnic


1 Answers

After digging through the various candidate solutions (use of Change Data Capture, adapters for SQL Server Service Broker, and possible conversions from MSMQ to RabbitMQ), I came to a solution that should work for you.

It turns out you can bind WCF clients and service contracts to SQL Server. From here, you can use RabbitMQ's AMQP binding for WCF to translate messages back and forth, as the aforelinked PDF documents in great detail.

I'm unclear on whether an additional transaction manager like XA will be required here, but if you suffer problems with transaction duplication, loops, and mismessaging, it's worth investigating as an intermediary for the connection. If you go that route, you'd need to weld that into your gateway in the same way you've defined in the problem statement. If this needs clarification, I'd be happy to expand on this here.

Best of luck with your application. It sounds like an integration hydra from the outside, but once you get everything talking together, it should work nicely.

like image 130
MrGomez Avatar answered Sep 27 '22 17:09

MrGomez