question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Update config for existing subscription

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
feywindcommented, May 31, 2021

@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 the SubscriberClient 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 the setMetadata 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!

1reaction
govindraicommented, May 28, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found