Update config for existing subscription
See original GitHub issueI want to manage Pub/Sub subscriptions automatically using the node.js API. Unfortunately, most properties of the subscription cannot be edited after it has been created. Specifialy, I want to be able to update:
ackDeadlineSeconds
retryPolicy
Both of these can be updated via the console UI or via the gcloud CLI, but it is frustrating that I have to abandon the simple, type safe world of node.js just to make these simple changes.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Change subscriptions | Stripe Documentation
Learn how to change existing subscriptions. ... Stripe supports changing existing subscriptions without having to cancel and recreate them.
Read more >Add an existing Azure subscription to your tenant
To associate an existing subscription to your Azure AD directory, follow these steps: ... Select Change directory. Screenshot that shows the ...
Read more >Manage App Store purchases, subscriptions, settings, and ...
Change or cancel an existing subscription. ... Change your App Store settings. Go to Settings > App Store, then do any of the...
Read more >How to register and subscribe a RHEL system to the Red Hat ...
After registration, use the following command to attach any available subscription that matches the current system. Raw. # subscription-manager ...
Read more >Subscription Switching Guide - WooCommerce
Customize the button text displayed next to a subscription under WooCommerce > Settings > Subscriptions. Subscriptions Switching Button Text. Upgrade or ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hongalex @kamalaboulhosn Maybe this is something we should add to the list of stuff to look at with future API updates across languages? I do agree
setMetadata
is kind of unobvious for this.The reason there are those two
updateSubscription
methods, by the by, is that theSubscriberClient
is the “raw” generated (gapic) library. The other one (Subscriber
) is an old veneer layer (all handwritten) that was ported to the newer gapic layer. It’s also pseudo-private; the intended method would’ve been thesetMetadata
up top.I do think the veneer code is due for some updating, we’re just trying to avoid causing too much disruption to everyone. There’s been talk of having a new “clean” API that is up to date and more in line with the other libraries, and then just have an “old” API that plugs into that. But that’s not work that’s been scheduled or anything yet.
Anyway, I do appreciate the feedback!
@ForbesLindesay With the latest library, You can use
topic(topicName).subscription(subscriptionName).setMetadata({...updates})
to update those values. Official Example here.@feywind my 2 cents, this is poor name for a method that update a subscription. A better name would’ve been simply updateSubscription. Surprisingly there is also a Subscriber#updateSubscription and SubscriberClient#updateSubscription that accomplishes the same. Too many ways to do the same thing… very confusing docs due to too much internal api details exposed.