MSMQ 与临时表转储 [英] MSMQ vs Temporary Table Dump

查看:26
本文介绍了MSMQ 与临时表转储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道之前有人问过这个问题.但环顾四周,我仍然无法确定我应该走哪条路.这是我的情况,希望你能帮忙:

I know this question has been asked a bit before. But looking around I still cant make my mind up which route I should go down. Here's my scenario, hopefully you can help out:

我们将拥有一系列 Web 服务,它们将按计划被数百个移动应用程序访问.这些服务将在设备上提供数据,同时将新信息发送到设备并从它们返回.从设备返回的数据需要更新单个中央 SQL 服务器数据库,该数据库还提供多个桌面应用程序和网站.

We will have a series of web services that will be hit on a scheduled basis by hundreds of mobile applications. These services will data on the device with new information both going to the devices and coming back from them. The data returned from the devices will need to update a single central SQL server database that also feeds several desktop applications and a website.

为了减少这些服务的请求/响应时间,我们决定在事后处理来自设备的数据,方法是将它们粘贴在 MSMQ 实例中或将序列化对象存储在临时数据中存储并让 Windows 服务稍后处理它们.

In order to reduce the amount of time for the request/response of these services we have decided to process data coming in from the devices after the fact by either sticking them in an MSMQ instance or storing the serialized objects in a temporary data store and having a windows service process them later.

所以这是我的选择,但除此之外,还有一些可以帮助你们给我建议的事情:

So there's my choices, but aside from this here's a few more things that might help you guys advise me:

  • 设备返回的数据不会以较小的消息包形式返回,需要服务器端订购.
  • 我对 MSMQ 一无所知,但我以前编写过 Windows 服务.尽管如果需要,我可以毫无问题地选择 MSMQ.
  • 我想保留设备的响应,以防万一由于数据引起的某种原因处理失败.通过这种方式,我可以查询数据并查看是否存在问题,即设备允许用户添加扩展服务器端数据库中相关字段长度的注释.

根据这些信息,您认为值得我学习 MSMQ 还是应该坚持使用更简单的解决方案?

With this information, do you think it is worth me looking into learning MSMQ or should I stick with the simpler solution?

克里斯.

推荐答案

MSMQ 不是一个糟糕的选择,绝对不难学习,但请记住,您应该注意一些限制条件.

MSMQ isn't a bad choice and is definitely not difficult to learn, but keep in mind that there are some constraints that you should be aware of.

>

缺点:

  • 每个队列只能是 2GB.
  • 每条消息 4MB(尽管可以通过将 MSMQ 与 WCF 结合使用来修复 4MB 的限制).
  • 仅适用于 Windows,因此您只能将其与 .NET、C/C++ 或 COM 库一起用于支持 COM 的环境.

优点:

  • 支持 Windows 网络负载均衡器.
  • 支持微软集群服务.
  • 与 Active Directory 集成.
  • 随 Windows 一起发货.
  • 支持交易.
  • MSMQ 消息可以通过 Windows 事件日志中的审核消息进行跟踪.
  • 可以在发送时自动对消息进行身份验证(签名)或加密,并在接收时进行验证和解密.

您可能要考虑的另一种方法是将数据写入临时表.这可能是个好主意,因为您希望有一个消息回溯日志.

Another approach you might want to consider is writing your data to a staging table. This might be a good idea since you want to have a message back log.

当我不了解系统架构的其余部分时,很难给出建议,但我希望这个答案会有所帮助.

It's difficult giving advice when I don't know the rest of the system's architecture, but I hope this answer will help a little.

有用的链接

在 .NET 中编写 MSMQ - 第 1 部分
将 MSMQ 与 WCF 结合使用

这篇关于MSMQ 与临时表转储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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