确定 Azure 服务总线队列中有多少消息 [英] Determining how many messages are on the Azure Service Bus Queue

查看:42
本文介绍了确定 Azure 服务总线队列中有多少消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道有一种方法可以确定 Azure 队列(存储帐户)中的消息数量(或近似数量);但是,有没有办法查询 Azure Service Bus 队列中待处理消息的数量?

I know there is a way to determine the number of messages (or approximate number) in the Azure Queue (Store Account); however is there a way to query for the number of pending messages on an Azure Service Bus queue?

推荐答案

var nsmgr = Microsoft.ServiceBus.NamespaceManager.CreateFromConnectionString(connectionString);
long count = nsmgr.GetQueue(queueName).MessageCount;

这篇关于确定 Azure 服务总线队列中有多少消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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