只是想确认如何将消息发送到远程事务性消息队列。
假设我有两台机器,A 和 B。
机器 A 有一个用于接收消息的事务队列。 Windows 服务监视此队列并对数据执行某些操作(将其保存到 SQL Server)。
机器 B 正在运行需要写入机器 A 上的队列的应用程序。
几个问题:
一种。如果是这样,这是默认行为,还是仅在发送“IsRecoverable”属性时才会发生?
湾队列是事务性的这一事实对这种行为有什么影响吗?
一种。是不是坐在本地,等待msmq服务将消息投递到远程队列?
湾或者消息是否位于远程机器上的队列中?
我在解释文档时遇到问题。在某些地方,我看到描述了存储和转发行为,但我无法理解这是否是事务队列的默认行为,或者我是否需要明确地做一些事情来实现这一点。
最佳答案
要了解事务性 MSMQ 的主要内容是,在将消息事务性传输到远程队列时,实际上涉及 3 个不同的事务。
所以回答你的问题:
When sending the message, is a local copy created on Machine B, before it gets delivered to machine A?
是的
If so, is this behavior by default, or does it only occur when the "IsRecoverable" property is sent?
默认情况下。这就是所谓的 store and forward .
Does the fact that the queue is transactional have any effect on this behavior?
没有,除非出现故障。
Since I'm using a transactional queue, where is the data once the transaction commits?
这取决于您指的是哪种交易(见上文)
Is it sitting locally, waiting for the msmq service to deliver the message to the remote queue?
仅当远程队列不可用时。
Or Is the message sitting in the queue on the remote machine?
如果接收方服务未能成功处理消息(处理程序中有异常),消息将保留在远程队列中。
关于msmq - MSMQ 事务性消息传递如何工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7650788/