gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 09:46:02 29 4
gpt4 key购买 nike

我正在事务中从 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com