集成SQL Service Broker和NServiceBus [英] Integrating SQL Service Broker and NServiceBus

查看:111
本文介绍了集成SQL Service Broker和NServiceBus的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的要求是我要拥有状态不同的物品。我需要根据这些项目的状态(发送电子邮件,存储文件,更新内部应用程序等)来做各种不同的事情。问题在于更新这些状态的应用程序是第三方,因此我无法更新它;更困难的是,只有一半的组织正在使用此系统,而另一半正在使用其将来的替代品。我确实可以同时使用两个数据库。

My requirement is that I have "items" with different states. I need to do all kinds of different things based on the states of these items (send emails, store files, update internal applications, etc). The problem is that the application that updates these statuses is third party, so I can't update it; furthering the difficulty is the fact that only half of the organization is using this system and the other are using it's future replacement. I do have open access to both of the databases used.

我的计划是通过触发器在 Item <的每个表示形式上使用ID和状态将消息添加到SQL Service Broker队列中。 / code>表。然后,从SSB激活过程中调用CLR过程,该过程通过NServiceBus将消息添加到发布队列中。

My plan is to add a message to a SQL Service Broker Queue with and ID and the status via a trigger on each representation of the Item table. Then, call a CLR procedure from the SSB activation procedure that adds a message to a publish queue via NServiceBus.

在我尝试注册我的主机之前,这一切似乎都进行得很好。 SQL中带有 CREATE ASSEMBLY 的程序集:

This all seemed to be going well until I tried to register my assemblies in SQL with CREATE ASSEMBLY:

Msg 10327, Level 14, State 1, Line 1
Warning: The Microsoft .NET Framework assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a, processorarchitecture=x86.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.

etc. etc. etc.

CREATE ASSEMBLY for assembly 'System.Web' failed because assembly 'System.Web' is not authorized for PERMISSION_SET = UNSAFE.  The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.
Msg 10301, Level 16, State 1, Line 2
Assembly 'log4net' references assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.
Msg 6218, Level 16, State 3, Line 3
CREATE ASSEMBLY for assembly 'NServiceBus.Core' failed because assembly 'NServiceBus.Core' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message
Msg 6218, Level 16, State 3, Line 4
CREATE ASSEMBLY for assembly 'NServiceBus' failed because assembly 'NServiceBus' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message

首先,我想知道这是否是完全疯狂的主意。我希望消息按顺序处理并异步添加到队列中。 NServiceBus提供了一个宿主应用程序,可以在需要时很容易地启动新的发布者。替代方法似乎是编写一个Windows服务,该服务监视SSB队列,然后发布。我想要一些意见或建议。谢谢。

First, I want to know if this is a completely crazy idea. I want the messages processed in order and added to the queues asynchronously. NServiceBus provides a host application that makes it very easy to spin up a new publishers when needed. The alternative seems to be to write a windows service that monitors the SSB queue and then publish. I'd just like some opinions or advice. Thanks.

推荐答案

看看 NServiceBus-Contrib

这篇关于集成SQL Service Broker和NServiceBus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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