未使用 PubSub 消息时会发生什么情况?

What happen to PubSub messages when not consumed?

根据 Cloud PubSub documentation 消息,如果 7 天内未使用,消息将停止存储。

Retains unacknowledged messages in persistent storage for 7 days from the moment of publication.

7 天保留期满后,邮件将被删除。不会为这些删除生成长条目。虽然您可以在 Stackdriver 中设置 alerting on the subscription/oldest_unacked_message_age metric 以了解何时有接近 7 天保留限制的消息,但没有确定删除了多少消息的指标。