MSMQ事务性消息传递如何工作? [英] How does MSMQ Transactional Message Delivery work?

查看:185
本文介绍了MSMQ事务性消息传递如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只想获得有关将消息发送到远程事务消息队列的工作方式的确认.

Just wanted to get confirmation on how sending messages to remote transactional message queues works.

假设我有两台机器,A和B.

Suppose I have a two machines, A and B.

机器A具有用于接收消息的事务性队列. Windows服务监视此队列并对数据执行某些操作(将其保留到SQL Server). 机器B运行的应用程序需要写入机器A上的队列.

Machine A has a transactional queue that is used for receiving messages. A windows service monitors this queue and does something with the data (persists it to a SQL Server). Machine B is running an application that needs to write to the queue on Machine A.

几个问题:

  1. 在发送消息时,是否在机器B上创建了本地副本,然后才将其传递到机器A?
    一种.如果是这样,此行为是默认行为,还是仅在发送"IsRecoverable"属性时才会发生?
    b.队列是事务性的事实对此行为有影响吗?

  1. When sending the message, is a local copy created on Machine B, before it gets delivered to machine A?
    a. If so, is this behavior by default, or does it only occur when the "IsRecoverable" property is sent?
    b. Does the fact that the queue is transactional have any effect on this behavior?

由于我正在使用事务性队列,因此事务提交后,数据在哪里? 一种.它是否位于本地,等待msmq服务将消息传递到远程队列?
b.还是消息坐在远程计算机上的队列中?

Since I'm using a transactional queue, where is the data once the transaction commits? a. Is it sitting locally, waiting for the msmq service to deliver the message to the remote queue?
b. Or Is the message sitting in the queue on the remote machine?

我在解释文档时遇到麻烦.在某些地方,我看到已描述了存储和转发行为,但是我很难理解这是否是事务性队列的默认行为,还是我是否需要明确地做一些事情才能实现.

I'm having trouble interpreting the documentation. In some places I see that the store and forward behavior is described, but I'm having trouble understanding whether that is the default behavior with transactional queues or if I need to do something explicitly to get that going.

推荐答案

关于事务型MSMQ的主要理解是,在消息到远程队列的事务性传输中实际上涉及3个不同的事务.

The main thing to understand about transactional MSMQ is that there are actually 3 distinct transactions involved in a transactional transmission of a message to a remote queue.

  1. 发件人将消息写入本地临时队列.
  2. 发送方计算机上的队列管理器通过有线将消息传输到接收方计算机上的队列管理器.
  3. 接收方服务处理队列消息,然后从队列中删除该消息.

因此,回答您的问题:

发送消息时,是在机器B上创建的本地副本,之前 它被交付给机器A了?

When sending the message, is a local copy created on Machine B, before it gets delivered to machine A?

如果是这样,默认情况下是此行为,还是仅当 已发送"IsRecoverable"属性吗?

If so, is this behavior by default, or does it only occur when the "IsRecoverable" property is sent?

默认情况下.这就是所谓的存储和转发.

By default. This is what is known as store and forward.

队列是事务性的事实对此有任何影响吗? 行为?

Does the fact that the queue is transactional have any effect on this behavior?

否,除了出现故障时.

No except for when there is a failure.

由于我使用的是事务性队列,因此一旦 交易提交?

Since I'm using a transactional queue, where is the data once the transaction commits?

这取决于您要进行的交易(请参见上文)

It depends which transaction you mean (see above)

它是否位于本地,等待msmq服务交付 消息发送到远程队列?

Is it sitting locally, waiting for the msmq service to deliver the message to the remote queue?

仅当远程队列不可用时.

Only if the remote queue is not available.

还是消息位于远程计算机上的队列中?

Or Is the message sitting in the queue on the remote machine?

如果接收方服务未能成功处理消息(处理程序中存在异常),则消息将保留在远程队列上.

If the receiver service fails to process the message succesfully (there is an exception in the handler) the message will stay on the remote queue.

这篇关于MSMQ事务性消息传递如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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