3

We are using Sql 2012 database server. When ever the db modifies we want it to trigger a message that can be stored in a queue using activemq.

  1. We are not sure how can we code to trigger a db so that it sends a message.
  2. Can we directly make the message generated from db to get queued in activemq without any java interface in between. I would want to know whether we can achieve this or not. 3.Are there any other ways to set up a communication between sql server and activemq say between database services and activemq services(does activemq have that)

PS i am a new user of activemq. Any leads to solve these queries is appreciated.

shiva
  • 77
  • 7
  • Related: http://stackoverflow.com/questions/13820199/can-a-sqlserver-trigger-push-to-activemq – David Brabant Sep 03 '13 at 12:58
  • @DavidBrabant as per [this link](http://stackoverflow.com/questions/12805377/what-is-activemq-used-for) says "Message oriented middleware like ActiveMQ on the other hand are build to handle those use cases. " it is possible – niren Sep 03 '13 at 13:06
  • @DavidBrabant what about point 3 can we achieve this? Also i felt that as per the post , there will be too many issues to handle but is it possible to do that ? the answer might be yes. – shiva Sep 03 '13 at 13:13

1 Answers1

0

Please don't as SQL Server to do this. SQL Server is designed to store data. You are asking too much of it. Depending on how many places you would want to add to this queue from, I would choose one of the following solutions:

  1. If you want to add to this queue from a bunch of different places, and don't want to change existing code, create an application to move items from SQL Server to ActiveMQ. The items in SQL Server can be populated by a trigger.

  2. If there are only a few places that add to this queue, add that logic to the application so that every write to SQL Server will also write to ActiveMQ.

If you really still don't want to modify any code, you can configure ActiveMQ to use SQL Server as its persistence database. Then you can modify its data and hope that it plays nice. This is definitely not preferable. I would rather put CLR code into SQL Server to push data to ActiveMQ.

John Tseng
  • 6,262
  • 2
  • 27
  • 35
  • Without wanting to vote this down, as points 1 & 2 are correct, you should never modify data within ActiveMQ's store and hope for the best. Doing so is a gross violation of encapsulation. – Jakub Korab Sep 03 '13 at 21:04
  • @John Tseng Thanks for the reply. As of now we have a single database and we are trying to link this up with activemq. So i guess we have follow what you have mentioned in step 2. So the application that you are talking about will be an interface between server and active mq.please correct me if i am wrong . – shiva Sep 04 '13 at 05:03