我正在尝试获取队列和 DeadLetterQueue 中的消息计数。常规队列有效。死信则不然。
这有效:
NamespaceManager
.CreateFromConnectionString(connectionString)
.GetQueue(queueName)
.MessageCount;
失败:
NamespaceManager
.CreateFromConnectionString(connectionString)
.GetQueue(queueName + "/$DeadLetterQueue")
.MessageCount;
错误消息(已编辑):
System.ArgumentException: The remote server returned an error: (400) Bad Request.
The specified HTTP verb (GET) is not valid.
这不可能吗?
最佳答案
使用.MessageCountDetails 属性而不是.MessageCount。 MessageCountDetails 有许多计数属性,其中之一是 DLQ。
关于azure - 如何查询Azure服务总线中$DeadLetterQueue的MessageCount?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27590517/