MSMQ 与 SQL Server Service Broker
我的应用程序由三部分组成:
- 面向最终用户和业务合作伙伴的前端网上商店
- 、用于处理这些订单的订单管理系统、
- 用于处理今天订购的产品和服务的所有技术细节的技术数据库系统
,这些系统(位于不同的服务器上并由不同的团队开发)使用 WCF Web 服务进行互操作。
只要所有服务器都正常运行,此设置就可以正常工作。但事实并非如此——至少也不总是如此。
因此,我开始考虑使用 MSMQ 或 SQL Server Service Broker 来处理这些系统之间的通信 - 至少当涉及到将订单存储到订单管理系统中的网上商店或发送技术数据的订单管理系统时到技术数据库系统。
我希望整个系统能够实现更高的可靠性——即使订单管理后端暂时不可用,用户仍然可以下订单并且订单不会丢失。
但最大的问题是:MSMQ 还是 Service Broker?所有三个系统均基于 Windows 和 .NET,并且已在三个独立的服务器上使用 SQL Server。
有没有人有一些可靠的、现实的事实来支持(或反对)这两种技术中的一种?您对这两组技术的实际体验如何?优点和缺点。如果你可以从头开始 - 你会选择哪一个?或者你会完全选择其他东西(什么?)?
I have an application that consists of three parts:
- a front-end web shop for end-users and business partners
- an order-management system to handle those orders
- a technical database system to handle all the technical details of those products and services ordered
Today, those systems (which are on separate servers and being developed by separate teams) interoperate using WCF webservices.
This setup up works fine - as long as all servers are up. Which they're not - not always, anyway.
So I've started looking at using either MSMQ or SQL Server Service Broker to handle the communication between those systems - at least when it comes to the web shop storing an order into the order management system, or the order management system sending the technical data to the tech database system.
I'm hoping to achieve more reliability in the entire system - users can still place orders and those won't get lost, even if the order management backend is temporarily unavailable.
But the big question is: MSMQ or Service Broker?? All three systems are Windows- and .NET based, and use SQL Server already - on three separate servers.
Does anyone have some solid, real-world facts that speak for (or against) one of those two technologies? What are your real-life experiences with those two sets of technologies? Pros and cons. If you could start from scratch - which one would you choose? Or would you pick something else (what?) entirely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在不同的情况下都使用过这两种方法,效果同样好。我的偏好非常基本:如果消息发送事件是由数据库事件触发的,则使用 SQL Service Broker;如果事件在代码中,则使用消息队列。这种偏好只是因为在触发事件的同一平台上进行设置更容易。
I have used both, in different situations, equally well. My preference is really pretty basic: use SQL Service Broker if message sending event is triggered from a database event; Use message queue if event is in code. That preference is based just that it easier to setup on the same platform that will trigger the event.