Is it possible to change the global expiration date for a PubSub subscription without re-creating it?

We created a pull PubSub subscription with a default validation period of 10 seconds using the GCP web interface. It turns out that we were too optimistic, and it took us more than 10 seconds to process the batch of popped messages. The service does not throw exceptions, it actually processes all messages, but since the deadline has passed, in some cases we process re-sent messages more than once. Is there a way to update the default deadline for a subscription? We know that this can be done for each message. We also know that this can be done for push subscriptions using the REST API. We would like to avoid code changes, as well as recreate 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 confirmation period, is there a safe way to do this on the fly, without having to disconnect consumers, so that there are no messages published in the topic, meanwhile lost?

+7
source share
2 answers

It turns out there is an alpha release of the gcloud command line function for this, see gcloud alpha pubsub subscriptions for updated documentation for more details.

Unfortunately, as stated in the documentation, this feature is part of the invitation only for the basic cloud Pub / Sub API.

+3
source

You can now update the subscription confirmation deadline without re-creating it. This can be done through the gcloud console or command line.

I am not sure exactly when it was added as a function, but it is really very convenient.

0
source

Source: https://habr.com/ru/post/1263846/


All Articles