远程发送时NServiceBus消息消失
当我们使用 System.Messaging 远程发送消息时,它可以正常工作,即我可以在远程计算机的队列中看到该消息。
然而,当我们尝试执行相同的任务时,即使用 NServiceBus 远程发送消息时,该消息不会出现在远程队列中,看起来消息消失了。
在客户端 app.config 文件中有以下配置:
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="CCSMessage.ITaskCompleted, CCSMessage" Endpoint="[email protected]" />
</MessageEndpointMappings>
</UnicastBusConfig>
注意,我们 客户端使用以下流畅的配置:
Configure.With()
.CastleWindsorBuilder(_container)
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
有什么我们明显做错的事情吗?
When we use System.Messaging to send a message remotely, it work correctly i.e. I can see the message on the queue in the remore machine.
However when we attempt to perform the same task i.e. send a message remotely using NServiceBus, the message does not appear in the remote queue, it seems the message disappears
Note, we have the following configuration in the clients app.config file:
<UnicastBusConfig>
<MessageEndpointMappings>
<add Messages="CCSMessage.ITaskCompleted, CCSMessage" Endpoint="[email protected]" />
</MessageEndpointMappings>
</UnicastBusConfig>
We bootstrap the client using the following fluent configuration:
Configure.With()
.CastleWindsorBuilder(_container)
.XmlSerializer()
.MsmqTransport()
.IsTransactional(true)
.PurgeOnStartup(false)
.UnicastBus()
.ImpersonateSender(false)
.CreateBus()
.Start();
Is there anything that we are obviously doing incorrectly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
鉴于客户端和服务器位于不同的计算机上,您应该在客户端的内部出站队列中看到该消息(如果它们位于同一台计算机上,则不会)。该消息将保留在那里,直到可以传递到服务器为止。确保分布式事务协调器正在两台计算机上运行。还要确保服务器的 app.config 中的 InputQueue 匹配。还要确保服务器 NSB 队列是本地的和事务性的。
Given that the client and server are on different machines, you should see the message in the internal outbound queue of the client(if they are on the same machine you will not). The message will be held there until it can be delivered to the server. Make sure the Distributed Transaction Coordinator is running on both machines. Also make sure that the InputQueue in the app.config of the server matches. Also make sure the the server NSB queue is local and transactional.