在Azure Service Bus中获取消息统计信息 [英] Getting Message Stats in Azure Service Bus

查看:88
本文介绍了在Azure Service Bus中获取消息统计信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个实用程序来监视我们的Azure Service Bus主题和订阅.

I am writing a utility to monitor our Azure Service Bus Topics and Subscriptions.

我可以获取主题详细信息,例如名称,排队的邮件数和空字母邮件数,但是我想获取已处理的邮件数.

I can get the Topic details, such as name, queued message count and dead-letter message count, but I would like to get the number of messages that have been processed.

这是我正在使用的代码:

Here is the code I am using:

var sub = namespaceManager.GetSubscription(topicPath, subscriptionName);

var name = sub.Name;
var pending= sub.MessageCountDetails.ActiveMessageCount;
var deadletter = sub.MessageCountDetails.DeadLetterMessageCount

GetSubscription似乎不包含任何属性来获取已处理消息的数量.

It seems that GetSubscription does not include any properties to get the number of messages processed.

以前有人尝试过这样做吗?

Has anyone tried to do this before?

推荐答案

借助最新的

It is possible to fetch the Total Count of Messages in a Topic, Incoming Messages, Outgoing Messages with the help of the latest Azure Monitor Metrics. In your case, count of Outgoing messages will be the number of processed messages.

这篇关于在Azure Service Bus中获取消息统计信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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