到 MSMQ 还是不到 MSMQ? (或 SQL 表作为队列)
我有一个分布式系统,其中有 1 个 SQL Server、1-n 个处理服务器和 1-n 个数据提供者(网络上的硬件设备)。提供的数据在进入关系数据库结构之前需要进行处理 - 由处理服务器执行(作为 Windows 服务 - .net 代码来解析数据、处理数据并将其插入关系结构中。)
为了处理潜在的负载并且不减慢数据提供者的速度,我想实现一个队列,但我不确定是否要增加 MSMQ 服务器的复杂性。 MSMQ 是否有一个好的替代方案,例如使用 DB(平面表)作为队列? .NET 是否为数据库队列提供任何开箱即用的支持,或者是否有其他可靠队列的选项?
谢谢
编辑:(11 月 29 日,晚上 11:30)
听起来 SQL Service Broker (SSB) 可能可以解决这个问题。
http: //www.netframeworkdev.com/windows-communication-foundation/service-broker-vs-msmq-as-reliable-queueing-mechanism-63981.shtml
编辑:(11 月 30 日,上午 7:45)
找到了关于此主题的另一个非常有用的链接:
http://social. msdn.microsoft.com/Forums/en-US/sqlservicebroker/thread/52687510-0852-44f3-bfcd-83610d1c1b9a
我还在研究将提供的数据的最大/最小大小。在他们的头顶上,有谁知道 MSMQ 和/或 SSB 能容纳的最大尺寸吗?
MSMQ:4MB消息大小
SSB:2GB 消息大小
编辑:(11 月 30 日,上午 8 点;15 点)
MSMQ 和 MSMQ 之间的很好的比较单边带在这里:
消息队列的好策略?
I've got a distributed system where there will be 1 SQL Server, 1-n processing servers, and 1-n data suppliers (hardware devices across the network). The data being supplied will require processing prior to going into the relational DB structure - performed by the processing servers (as windows services - .net code to parse the data, process it, and insert it into the relational structure.)
To handle the potential load and not slow down the data suppliers, I want to implement a queue, but I'm not sure I want to add the complexity of an MSMQ server to the mix. Is there a good alternative to MSMQ, such as using the DB (a flat table) as the queue? Does .NET provide any out-of-the-box support for DB queues, or is there another option for reliable queueing?
Thanks
EDIT: (29 Nov, 11:30pm)
sounds like SQL Service Broker (SSB) might do the trick.
http://www.netframeworkdev.com/windows-communication-foundation/service-broker-vs-msmq-as-reliable-queueing-mechanism-63981.shtml
EDIT: (30 Nov, 7:45am)
Found another very useful link on this subject:
http://social.msdn.microsoft.com/Forums/en-US/sqlservicebroker/thread/52687510-0852-44f3-bfcd-83610d1c1b9a
I'm also looking into the max/min size of the data that will be supplied. Of the top of their head, does anyone know the max size accommodated by MSMQ and/or SSB?
MSMQ: 4MB message size
SSB: 2GB message size
EDIT: (30 nov, 8;15am)
Great comparison between MSMQ & SSB here:
Good Strategy for Message Queuing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会使用 MSMQ,它不会增加太多复杂性,而且备份消息非常容易,因此即使在系统重新启动后也可以继续处理。您可以使用 SSB 之类的东西。
I would use MSMQ, it doesnt add that much complexity, and it is so easy to backup the messages, so processing can continue even after a system restart. You could use something like SSB.
在这两个选项中,MSMQ 实际上更为简单。如果您需要能够重新确定工作的优先级,或者让处理代理仅选择某些类型的排队作业,则不能使用 MSMQ。如果您不需要任何这些花里胡哨的东西,那么 MSMQ 与 .NET 一起使用是很方便的。
Out of the two options, MSMQ is actually the more simplistic. If you need the ability to re-prioritize work, or have processing agents only pick certain types of queued jobs, then you cannot use MSMQ. If you do not need any of those bells and whistles, then MSMQ is cake to use with .NET.