事务性与非事务性MSMQ [英] transactional vs. non-transactional msmq

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

问题描述

我一直看到文档表示无法将其发送到事务范围之外的远程事务msmq队列.我很难相信,因为我认为我已经做了好几周了.我有一个小应用程序,可将消息发布到具有事务性的远程队列中.只是为了试验性能,客户端的各种版本都使用TransactionScope来包装发送操作,也可以不使用.最终,使用一些补偿性事务逻辑似乎更聪明,更快捷,因此放弃了在客户端和服务器上使用TransactionScope.事实是,消息似乎仍然显示在队列中,并且可以被服务处理而没有任何问题.

I keep seeing documentation saying that its not possible to send to a remote transactional msmq queue, outside the scope of a transaction. I'm finding this hard to believe because I think I've been doing exactly that for weeks now. I have a small app that posts messages to a remote queue that is transactional. Just to experiment with performance, various versions of the client have either used a TransactionScope to wrap the send operation or not. Ultimately, using some compensating transaction logic seemed a lot smarter and faster, so use of TransactionScope on both client and server were dropped. The thing is, messages still seem to show up on the queue, and get processed by the service without any problem.

有人可以向我解释我在这里想念的是什么吗?我只是在变胖吗?随意这么说(肯定不会是第一次).

Can anybody explain to me what it is that I'm missing here? Am I just being thick? Feel free to say so (it certainly won't be the first time).

推荐答案

您使用TransactionScope引用的事务由dtc(分布式事务处理协调器)实现. msmq(如sql)具有其内部事务引擎.消息中有一个属性,指出该消息是事务性消息.您可能在代码中的某个位置设置了它.

The transaction you refer to with the TransactionScope are implemented by the dtc ( distributed transaction coordinator). msmq (like sql) have its internal transaction engine. There is a property in the message that states that its a transactional message. And you probably set it somewhere in you code.

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

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