How do you get the message count for Azure Topic Subscription?

做~自己de王妃 提交于 2019-12-18 13:13:32

问题


Is there a way to get the current message count for an Azure topic subscription?

I see that the SubscriptionDescription class has a MessageCount property, but this class appears to only be used to create a subscription. I don't see a way to retrieve a SubscriptionDescription object for an existing subscription.


回答1:


I found what I was looking for:

var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
var subscriptionDesc = namespaceManager.GetSubscription(topicPath, subscriptionName);
long messageCount = subscriptionDesc.MessageCount;


来源:https://stackoverflow.com/questions/13957339/how-do-you-get-the-message-count-for-azure-topic-subscription

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!