如何修改Google Cloud Pub/Sub后台Cloud Function的订阅确认截止时间

How to modify Google Cloud Pub/Sub subscription acknowledgement deadline for background Cloud Function

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

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

使用推送端点(可能是 App Engine 标准端点,但据称不需要 域验证 https://cloud.google.com/pubsub/docs/push#other-endpoints).

对于生成的 subscription/endpoint 似乎没有办法 register/verify 域 (https://www.google.com/webmasters/verification, https://console.cloud.google.com/apis/credentials/domainverification)

因此用户无法更改订阅,例如:

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

会产生类似 "INVALID_ARGUMENT: The supplied HTTP URL is not registered in the subscription's parent project"

的结果

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

当通过 Cloud Functions 连接到 Cloud Pub/Sub 主题时,系统会为您创建一个订阅。此订阅由 Cloud Functions 管理,因此无法更新确认截止日期。