如何修改后台Cloud Function的Google Cloud Pub/Sub订阅确认截止日期 [英] How to modify Google Cloud Pub/Sub subscription acknowledgement deadline for background Cloud Function

查看:129
本文介绍了如何修改后台Cloud Function的Google Cloud Pub/Sub订阅确认截止日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过以下方式为Cloud Pub/Sub部署后台Cloud Function时:

When deploying a background Cloud Function for Cloud Pub/Sub via:

gcloud functions deploy function_name --runtime python37 --trigger-topic some_topic

使用推送端点(可能是App Engine标准端点)会自动创建订阅,但据称这些订阅不需要 域验证 https://cloud.google.com/pubsub/docs/push#其他端点).

A subscription gets automatically created with a push endpoint (likely App Engine standard endpoint, but those are claimed to be without the need of domain verification https://cloud.google.com/pubsub/docs/push#other-endpoints).

对于生成的订阅/端点,似乎没有注册/验证域的方法 ( https://www.google.com/webmasters/verification

For the generated subscription/endpoint there doesn't seem like a way to register/verify the domain (https://www.google.com/webmasters/verification, https://console.cloud.google.com/apis/credentials/domainverification)

结果,用户无法更改订阅,例如:

As a result the user cannot alter the subscription, for instance:

gcloud alpha pubsub subscriptions update some_subscription --ack-deadline=10

将产生类似"INVALID_ARGUMENT:提供的HTTP URL未在订阅的父项目中注册"的信息

Would yield something like "INVALID_ARGUMENT: The supplied HTTP URL is not registered in the subscription's parent project"

通过GCP上的Web界面执行此操作也会产生错误:"pubsub错误INVALID_ARGUMENT"

Doing it via the web interface on GCP would also yield an error: "pubsub error INVALID_ARGUMENT"

推荐答案

通过Cloud Functions连接到Cloud Pub/Sub主题时,将代表您创建订阅.此订阅由Cloud Functions管理,因此无法更新确认截止日期.

When connecting to a Cloud Pub/Sub topic via Cloud Functions, a subscription is created on your behalf. This subscription is managed by Cloud Functions and therefore it is not possible to update the acknowledgement deadline.

这篇关于如何修改后台Cloud Function的Google Cloud Pub/Sub订阅确认截止日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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