【发布时间】:2011-12-02 14:22:57
【问题描述】:
我的应用有两个组件。一种是在媒体服务器上运行并在文件被修改时使用 NServiceBus 发布消息的通知程序进程(Notifier)。另一种是订阅这些消息以执行缓存失效等操作的 MVC Web 应用程序(PhotoWeb)。
我正在为 QA 设置暂存环境,问题是在暂存环境中运行的 PhotoWeb 应用程序正在接收来自暂存媒体服务器和实时媒体服务器的通知 - 这是出乎意料的,而且有点奇怪...
部署到生产环境的 PhotoWeb 实例具有以下配置:
<MsmqTransportConfig InputQueue="PhotoWebInputQueue" ErrorQueue="PhotoWebErrorQueue" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
<clear/>
<!-- Where do we subscribe to messages about filesystem changes? -->
<add Messages="MyProject.Messages" Endpoint="NotifierInputQueue@webmedia"/>
</MessageEndpointMappings>
</UnicastBusConfig>
暂存环境中的配置是:
<MsmqTransportConfig InputQueue="PhotoWebInputQueue" ErrorQueue="PhotoWebErrorQueue" NumberOfWorkerThreads="1" MaxRetries="5" />
<UnicastBusConfig>
<MessageEndpointMappings>
<clear/>
<!-- Where do we subscribe to messages about filesystem changes? -->
<add Messages="MyProject.Messages" Endpoint="NotifierInputQueue@staging_media"/>
</MessageEndpointMappings>
</UnicastBusConfig>
我想到了几个理论:
- 我误解了队列实际上是什么 -
PhotoWebInputQueue实际上是共享网络资源,而不是特定服务器本地的队列 - 之前的部署导致 NServiceBus 订阅暂存 Web 服务器上的实时 Web 媒体队列,并且此订阅在重新启动等过程中持续存在。
但是,我的 NServiceBus-fu 不够强大,无法知道如何测试这些理论中的任何一个。您可以看到此配置或架构有什么明显错误吗?
谢谢,
迪伦
【问题讨论】:
标签: msmq nservicebus publish-subscribe