Reputation: 2025
I found in the Google Pub/Sub documentation that a published message can wait for up to 7 days for the delivery to the subscriber and then it gets deleted. But is there a way to make this time shorter, like 10 seconds? Perhaps some message attribute or subscription configuration?
Upvotes: 2
Views: 2341
Reputation: 17251
The feature to allow one to change the retention time to make it shorter than 7 days is currently an alpha feature and cannot be set via the UI, but it can be set via the gcloud command-line tool. The shortest retention duration allowed is 10 minutes. To set this property, run the following:
gcloud alpha pubsub subscriptions update \
projects/<project>/subscriptions/<subscription> \
--message-retention-duration=10m
Upvotes: 4