gpt4 book ai didi

google-cloud-platform - gcloud pubsub subscriptions pull 经常报空消息列表

转载 作者:行者123 更新时间:2023-12-05 01:42:46 26 4
gpt4 key购买 nike

为什么“gcloud pubsub subscriptions pull”经常报空消息列表,而订阅中有消息需要确认?

效果见下图。消息 118870127432164 在订阅中可用,它从未被确认,但通常不会被报告。

lab@ubu1:~$ while :; do date; gcloud pubsub subscriptions pull projects/PROJECT/subscriptions/killbill-queue; done
Wed Jun 13 15:31:48 -03 2018
┌──────┬─────────────────┬───────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ DATA │ MESSAGE_ID │ ATTRIBUTES │ ACK_ID │
├──────┼─────────────────┼───────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 6�� │ 118870127432164 │ billingAccountId=000000-000000-000000 │ TDgBRElTK0MLKlgRTgQhIT4wPkVTRFAGFixdRkhRNxkIaFEOT14jPzUgKEUSAgVPAihdeTBLNkFddgA-DRlyfWF0bFlFUAEQB3ZfWBEMYlxORAdzMhhzdWlyalsRBgZGUX9ZXzOA6NOyt7d6ZiQ9XhJLLD5-MzRFQV5AEg │
└──────┴─────────────────┴───────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Wed Jun 13 15:31:50 -03 2018
Listed 0 items.
Wed Jun 13 15:31:53 -03 2018
Listed 0 items.
Wed Jun 13 15:31:56 -03 2018
Listed 0 items.
Wed Jun 13 15:31:59 -03 2018
┌──────┬─────────────────┬───────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ DATA │ MESSAGE_ID │ ATTRIBUTES │ ACK_ID │
├──────┼─────────────────┼───────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 6�� │ 118870127432164 │ billingAccountId=000000-000000-000000 │ TDgBRElTK0MLKlgRTgQhIT4wPkVTRFAGFixdRkhRNxkIaFEOT14jPzUgKEUSAgVPAihdeTBLNkFddgA-DRlyfWF0bFlFUAEQB3ZfWBEMYlxORAdzMhhzdWlyalsRBgZGUX9ZXzOA6NOyt7d6ZiQ9XhJLLD5-MzRFQV5AEg │
└──────┴─────────────────┴───────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Wed Jun 13 15:32:01 -03 2018
Listed 0 items.
Wed Jun 13 15:32:05 -03 2018
Listed 0 items.
Wed Jun 13 15:32:07 -03 2018
Listed 0 items.

最佳答案

您引用的提取消息是“未完成的”。这意味着在 Google Cloud Pub/Sub 认为它无法获得原始订阅者的确认之前,不应将其提供给其他订阅者。具体来说,它将等到“确认截止日期”,然后再向另一订阅者提供已发布的消息。

From Google's Pub/Sub Documentation (强调我的):

Once a message is sent to a subscriber, the subscriber must either acknowledge or drop the message. A message is considered outstanding once it has been sent out for delivery and before a subscriber acknowledges it. Cloud Pub/Sub will repeatedly attempt to deliver any message that has not been acknowledged or that is not outstanding. A subscriber has a configurable, limited amount of time, or ackDeadline, to acknowledge the message. Once the deadline has passed, an outstanding message becomes unacknowledged.

从您分享的上下文来看,您似乎看到了默认的确认截止期限超时:

An acknowledgment deadline: If your code doesn't acknowledge the message before the deadline, the message is sent again. The default is 10 seconds. The maximum custom deadline you can specify is 600 seconds (10 minutes).

关于google-cloud-platform - gcloud pubsub subscriptions pull 经常报空消息列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50844102/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com