计算Pubsub主题中未确认的消息数 [英] Count number of unacknowledged messages in a Pubsub topic

查看:95
本文介绍了计算Pubsub主题中未确认的消息数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在确认来自pubsub主题的所有消息后,我想执行一个操作.我尝试将Stackdriver Monitoring API用作指标被云区域分解的未确认消息数",但不了解区域过滤器以及为什么需要该过滤器.在哪里可以看到主题使用的区域?并且由于某些未知原因,对于某些主题,API调用完全没有理由失败.知道是否已确认所有消息的最佳方法是什么.

I would like to perform an action once all the messages from a pubsub topic have been acknowledged. I tried using Stackdriver monitoring API for the metric "Number of unacknowledged messages broken down by a cloud region" but did not understand the filter for region and why it is required. Where can I see what region my topics use? And for some unknown reason, for some of the topics, the API call fails for no reason at all. What is the best way of knowing if all messages have been acknowledged or not.

推荐答案

Cloud Pub/Sub主题没有未确认消息的概念.这纯粹是单个订阅的属性,尚未确认多少消息.

A Cloud Pub/Sub Topic has no concept of an unacknowledged message. This is purely a property of an individual Subscription, how many messages have not yet been acknowledged.

如果未确认,您可以使用 Stackdriver Alerting 来提醒您任何订阅中的邮件年龄都太高.将资源类型"设置为"Cloud Pub/Subscription",将指标"设置为最早的未确认消息",并在任何时间序列超出某个阈值时发出警报.

You can use Stackdriver Alerting to alert you if the unacknowledged message age in any subscription gets too high. Set Resource Type to "Cloud Pub/Sub Subscription" and Metric to "Oldest Unacked Message", and alert if any time series violates some threshold.

这篇关于计算Pubsub主题中未确认的消息数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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