msmq - 如何检索 MSMQ 消息的 AbortCount?

标签 msmq

我正在事务中从 MSMQ 检索消息。如果应用程序由于某种原因无法处理它们,则会中止事务。

一旦事务被中止,消息就会返回到队列中。如果再次检索消息,是否有办法知道该消息之前是否被中止?

通过MMC(MSMQ UI),您可以查看消息的属性以了解消息被中止的次数。

有没有办法以编程方式获取这个值?

最佳答案

来自 MSDN 站点:

To keep track of the number of times a message read is attempted, Windows Vista maintains a durable message property that counts the number of aborts and a move count property that counts the number of times the message moves between the application queue and subqueues. The WCF channel uses these to compute the receive retry count and the retry cycles count. On Windows Server 2003 and Windows XP, the abort count is maintained in memory by the WCF channel and is reset if the application fails. Also, the WCF channel can hold the abort counts for up to 256 messages in memory at any time. If a 257th message is read, then the oldest message's abort count is reset.

The abort count and move count properties are available to the service operation through the operation context. The following code example shows how to access them.

包含示例的页面是here .

关于msmq - 如何检索 MSMQ 消息的 AbortCount?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4911303/

相关文章:

php - 是否有使用 PHP over HTTP 将消息插入 MSMQ 3.0 的教程?

wcf - 启用已存在的 MSMQ 队列的 WCF 读取

c# - 事件通知引擎 - MSMQ

WCF MSMQ 单元测试

c# - MSMQ自定义消息格式

msmq - 事务性与非事务性 msmq

c# - MSMQ,消息被放入队列并消失但从未被服务契约(Contract)接收

automation - 使用 bat 文件或一些自动化的东西安装 MSMQ

msmq - 当另一端未收到消息时,消息队列(MSMQ)不会抛出异常

MSMQ是一个不错的选择?