简体   繁体   English

到MSMQ或不到MSMQ? (或SQL表作为队列)

[英]to MSMQ or not to MSMQ? (or SQL Table as the Queue)

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). 我有一个分布式系统,其中将有1个SQL Server,1-n处理服务器和1-n数据供应商(网络中的硬件设备)。 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.) 提供的数据需要在进入关系数据库结构之前进行处理 - 由处理服务器执行(作为Windows服务 - .net代码来解析数据,处理数据并将其插入关系结构中。)
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. 为了处理潜在的负载而不是减慢数据供应商的速度,我想实现一个队列,但我不确定是否要将MSMQ服务器的复杂性添加到组合中。 Is there a good alternative to MSMQ, such as using the DB (a flat table) as the queue? 是否有一个很好的MSMQ替代方案,例如使用DB(平面表)作为队列? Does .NET provide any out-of-the-box support for DB queues, or is there another option for reliable queueing? .NET是否为数据库队列提供任何开箱即用的支持,还是有另一种可靠的排队选项?
Thanks 谢谢

EDIT: (29 Nov, 11:30pm) 编辑:(11月29日,晚上11:30)
sounds like SQL Service Broker (SSB) might do the trick. 听起来像SQL Service Broker(SSB)可能会成功。
http://www.netframeworkdev.com/windows-communication-foundation/service-broker-vs-msmq-as-reliable-queueing-mechanism-63981.shtml http://www.netframeworkdev.com/windows-communication-foundation/service-broker-vs-msmq-as-reliable-queueing-mechanism-63981.shtml

EDIT: (30 Nov, 7:45am) 编辑:(11月30日,上午7:45)
Found another very useful link on this subject: 找到关于这个主题的另一个非常有用的链
http://social.msdn.microsoft.com/Forums/en-US/sqlservicebroker/thread/52687510-0852-44f3-bfcd-83610d1c1b9a 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和/或SSB容纳的最大尺寸?
MSMQ: 4MB message size MSMQ:4MB邮件大小
SSB: 2GB message size SSB:2GB邮件大小

EDIT: (30 nov, 8;15am) 编辑:(30 nov,8; 15am)
Great comparison between MSMQ & SSB here: MSMQ和SSB之间的比较很好:
Good Strategy for Message Queuing? 消息队列的好策略?

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. 我会使用MSMQ,它不会增加那么多复杂性,并且它很容易备份消息,因此即使在系统重启后处理也可以继续。 You could use something like SSB. 你可以使用像SSB这样的东西。

Out of the two options, MSMQ is actually the more simplistic. 在这两个选项中,MSMQ实际上更简单。 If you need the ability to re-prioritize work, or have processing agents only pick certain types of queued jobs, then you cant use MSMQ. 如果您需要重新确定工作的优先级,或者让处理代理只选择某些类型的排队作业,那么您就无法使用MSMQ。 If you dont need any of those bells and whistles, then MSMQ is cake to use with .NET. 如果你不需要任何这些花哨的东西,那么MSMQ就是用于.NET的蛋糕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM