.net Windows 上 MSMQ 的队列替代方案?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37579/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Queue alternatives to MSMQ on Windows?
提问by Thomas Lundstr?m
If you want to use a queuing product for durable messaging under Windows, running .NET 2.0 and above, which alternatives to MSMQ exist today? I know of ActiveMQ (http://activemq.apache.org/), and I've seen references to WSMQ (pointing to http://wsmq.net), but the site seems to be down.
如果您想在运行 .NET 2.0 及更高版本的 Windows 下使用排队产品进行持久消息传递,那么目前存在哪些 MSMQ 的替代品?我知道 ActiveMQ ( http://activemq.apache.org/),并且我看到过对 WSMQ 的引用(指向http://wsmq.net),但该站点似乎已关闭。
Are there any other alternatives?
还有其他选择吗?
采纳答案by RogerV
I can't begin to say enough good things about Tibco EMS - an implementation of the Java JMS messaging spec. Tibco EMS has superb support for .NET clients - including Compact Framework .NET on WinCE. (They also have C client libraries too.)
关于 Tibco EMS(Java JMS 消息传递规范的实现),我说不出太多好话。Tibco EMS 对 .NET 客户端有极好的支持——包括 WinCE 上的 Compact Framework .NET。(他们也有 C 客户端库。)
So if you're building a heterogeneous distributed application involving messaging code running on Windows, Unix (AIX/Solaris), Linux, or Mac OS X, then Tibco EMS is the ticket.
因此,如果您正在构建涉及在 Windows、Unix (AIX/Solaris)、Linux 或 Mac OS X 上运行的消息传递代码的异构分布式应用程序,那么 Tibco EMS 就是您的选择。
Check out my article here:
在这里查看我的文章:
Using JMS For Distributed Software Development
I used to work at Microsoft and did some implementation with MSMQ while there. But you know, Microsoft just concerns itself with Windows. They depended on 3rd parties to provide MSMQ clients to other platforms. My encounter with Tibco EMS was a much better experience. It was very evident that Tibco understood messaging much more so than Microsoft. And Tibco put the effort into supporting diverse client bindings themselves. That is why they eventually changed the product name from Tibco JMS to Tibco EMS (Enterprise Messaging Service).
我曾经在 Microsoft 工作,并在那里使用 MSMQ 进行了一些实现。但你知道,微软只关心 Windows。他们依靠第 3 方向其他平台提供 MSMQ 客户端。我与 Tibco EMS 的相遇是一次更好的体验。很明显,Tibco 比 Microsoft 更了解消息传递。Tibco 自己也努力支持不同的客户端绑定。这就是他们最终将产品名称从 Tibco JMS 更改为 Tibco EMS(企业消息服务)的原因。
And I did build heterogeneous software systems around Tibco EMS. Rolled C# .NET Winform clients interacting with Java/JBoss middle-tier via Tibco EMS messaging. (And also have WinCE industrial embedded computers that use the Compact Framework .NET Tibco client.)
我确实围绕 Tibco EMS 构建了异构软件系统。通过 Tibco EMS 消息传递与 Java/JBoss 中间层交互的滚动 C# .NET Winform 客户端。(还有使用 Compact Framework .NET Tibco 客户端的 WinCE 工业嵌入式计算机。)
回答by csmba
May not be "best practice" advice here... but based on real life needs and experience: we have distributed system, 60 boxes running each 10 clients all do task X, and they need to take the next task from a queue. The queue is being fed from one other "client"...
这里可能不是“最佳实践”建议……但基于现实生活的需求和经验:我们有分布式系统,每 10 个客户端运行 60 个盒子都执行任务 X,它们需要从队列中取出下一个任务。队列是从另一个“客户端”馈送的......
We had used inter process communication, we used MSMQ, we tried service broker... It just doesn't work in the long term because you are giving away the control of your application to Microsoft. It works great as long as your needs are satisfied. it becomes hell when you need something not supported.
我们曾经使用过进程间通信,我们使用过 MSMQ,我们尝试过服务代理……从长远来看,它不起作用,因为您将应用程序的控制权交给了 Microsoft。只要您的需求得到满足,它就会很好地工作。当你需要不支持的东西时,它就变成了地狱。
The best solution for us was: Use a SQL Database table as the queue. Don't reinvent the wheel there, since you will make mistakes (locks). There is info out there on how to do it, it is very easy and we handled over 200K messages per 24H (with 60x10 = 600 concurrent reads and writes to the queue). That is in addition to the same SQL server handling the rest of the application stuff...
对我们来说最好的解决方案是:使用 SQL 数据库表作为队列。不要在那里重新发明轮子,因为你会犯错误(锁)。有关于如何做到这一点的信息,它非常简单,我们每 24 小时处理超过 20 万条消息(60x10 = 600 并发读取和写入队列)。这是除了处理其余应用程序内容的相同 SQL 服务器之外...
Some reasons why MSMQ doesn't work:
MSMQ 不起作用的一些原因:
When you need to change the logic of the queue to not FIFO, but something like "the oldest RED message" or "the oldest BLUE message" you can't do it. (I know what people will say, you can do it by having a red queueand a blue queue.. .But what if the number/types of queues is dynamic based on the way the application is administrated and changes daily?)
It adds a point of failure and deployment nightmare (the queue is a point of failure and you need to deal with setting the right permissions on all boxes to read/write messages etc' in Enterprise software you pay in blood for these type of things). SQL server... all clients are writing/reading already from the DB, it is just one more table..
当您需要将队列的逻辑更改为非 FIFO,而是诸如“最旧的红色消息”或“最旧的蓝色消息”之类的内容时,您无法做到。(我知道人们会说什么,你可以通过一个红色队列和一个蓝色队列来实现......但是如果队列的数量/类型是基于应用程序的管理方式和每天变化的动态的呢?)
它增加了一个故障点和部署噩梦(队列是一个故障点,您需要处理在所有框上设置正确的权限以读取/写入消息等'在企业软件中,您为这些类型的事情付出了血汗钱) . SQL 服务器...所有客户端都已经从数据库写入/读取,它只是多一张表..
回答by Sixto Saez
The RabbitMQ frameworkseems to have been overlooked here. If folks still care, it does have a .NET 2.0 code base and it comes with a WCF binding similar to netMsmqBinding. The binding naturally requires at least .NET 3.0 and it has more features than the built-in netMsmqBinding. On top of it all, it is Mono friendly. Its worth a look.
RabbitMQ 框架似乎在这里被忽略了。如果人们仍然关心,它确实有一个 .NET 2.0 代码库,并且带有类似于 netMsmqBinding 的 WCF 绑定。绑定自然至少需要 .NET 3.0 并且它比内置的 netMsmqBinding 具有更多的功能。最重要的是,它对 Mono 友好。值得一看。
回答by Ubiguchi
What about SQL 2005's service broker?
SQL 2005 的服务代理呢?
回答by MotoWilliams
If cost isn't an issue (there is also an Express SKU) then take a look at the 800,000 pound gorilla. WebSphere MQ (MQ Series). It runs on practically any platform and supports so many different queue managers and messaging patterns it really isn't appropriate to list them here.
如果成本不是问题(还有一个 Express SKU),那么看看 800,000 磅的大猩猩。WebSphere MQ(MQ 系列)。它几乎可以在任何平台上运行,并支持许多不同的队列管理器和消息传递模式,因此在此处列出它们确实不合适。
- IBM's WebSphere MQ Site: http://www.ibm.com/software/integration/wmq/
- TheMQ Support Forum: http://www.mqseries.net/phpBB2/index.php
- IBM 的 WebSphere MQ 站点:http: //www.ibm.com/software/integration/wmq/
- 该MQ支持论坛:http://www.mqseries.net/phpBB2/index.php
回答by James Strachan
Why not use ActiveMQ? :)
为什么不使用 ActiveMQ?:)
回答by firegrass
If high availability is important Amazon SQS is worth looking at. There's not much additional overhead if messages come from different physical locations. Cheap and scalable!
如果高可用性很重要,那么 Amazon SQS 值得一看。如果消息来自不同的物理位置,则不会有太多额外的开销。便宜且可扩展!
回答by asyncwait
Redis is another hot breed on this platform. Check with their Set based queueing implementation and also Pub/Sub pattern. It looks promosing
Redis 是这个平台上的另一个热门品种。检查他们基于 Set 的排队实现以及 Pub/Sub 模式。看起来很宣传

