Google Cloud Functions 无法使用 Pub/Sub 死信主题

Nih*_*hil 5 google-cloud-platform google-cloud-pubsub google-cloud-functions

似乎 GCP Cloud Functions 在调用时总是 ACK Pubsub PUSH 消息,即使函数崩溃或失败也是如此。

这可以防止使用新的 Pub/Sub“死信”主题功能,该功能要求消息传递失败才能将其转发到其他主题。目前,消息永远不会失败。

有没有办法通过 Cloud Functions 利用“死信主题”或 pubsub 重新交付?除了在函数本身上设置“重试”标志之外,这并不能解决这个问题。

gui*_*ere 1

推送订阅意味着两件事:

  • 在 --trigger-http 模式下创建函数
  • 创建使用 Cloud Functions URL 的推送 PUSH 订阅。

这里你已经在 --trigger-topic 模式下创建了一个函数,它是一个后台函数。

You have here what you have to do for marking the function as failed.

Share your code if you need more help