我的SQL Server能否在两者之间没有任何Java应用程序的情况下将消息发送到activemq服务器 [英] Can my sql server send messages to activemq server without any java app in between

查看:109
本文介绍了我的SQL Server能否在两者之间没有任何Java应用程序的情况下将消息发送到activemq服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Sql 2012数据库服务器。一旦数据库修改,我们希望它触发一条消息,该消息可以使用activemq存储在队列中。

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. 我们不确定如何编写代码来触发数据库,​​以便它发送消息。

  2. 我们能否直接使从db生成的消息在activemq中排队,而两者之间没有任何Java接口。我想知道我们是否可以实现这一目标。
    3.是否还有其他方法可以在sql服务器和activemq之间建立通信,例如在数据库服务和activemq服务之间(activemq有)

PS我是activemq的新用户。

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

推荐答案

请不要以SQL Server身份执行此操作。 SQL Server旨在存储数据。你问的太多了。根据要从此队列添加多少个位置,我选择以下解决方案之一:

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. 如果您想要从多个不同的位置添加到此队列,并且不想更改现有代码,请创建一个应用程序以将项目从SQL Server移到ActiveMQ。可以通过触发器填充SQL Server中的项目。

  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.

如果只有几个地方添加到此队列中,则将该逻辑添加到应用程序中,以便

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.

如果您真的仍然不想修改任何内容,则也将写入ActiveMQ。代码,您可以配置ActiveMQ以将SQL Server用作其持久性数据库<​​/a>。然后,您可以修改其数据,并希望它能发挥作用。这绝对不是可取的。我宁愿将CLR代码放入SQL Server中以将数据推送到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.

这篇关于我的SQL Server能否在两者之间没有任何Java应用程序的情况下将消息发送到activemq服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆