10
votes

We have created a pull PubSub subscription with a default acknowledgement deadline of 10 seconds using the GCP web GUI. It turns out that we were too optimistic, and it takes our service more than 10 seconds to process a batch of pulled messages. The service does not throw exceptions, it does in fact process all of the messages, but because the deadline has passed, in some cases we end up processing redelivered messages more than once. Is there a way to update the default deadline for a subscription? We know this can be done per message. We also know that this can be done for a push subscription using the REST API. We would like to avoid code changes, as well as having to re-create the subscription with a new default deadline.

If there is no way to do this without deleting the subscription, and creating a new one with an extended acknowledgement deadline, is there a safe way to perform this on the fly, without the need to disable the consumers, so that no messages published to the topic in the meantime are lost?

2

2 Answers

3
votes

It turns out that there is an alpha release of a gcloud command line feature for this, see gcloud alpha pubsub subscriptions update documentation for more details.

Unfortunately, as the documentation states, this feature is part of an invitation-only release of the underlying Cloud Pub/Sub API.

1
votes

It is now possible to update the acknowledgment deadline for a subscription without re-creating it. It can be done via gcloud console or command line

I am not sure exactly when it was added as a feature but it very handy indeed.