GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — pubsub: support generated subscription names by stephenplusplus · Pull Request #1799 · googleapis/google-cloud-node Conversation
|
| * | ||
| * @private | ||
| */ | ||
| Subscription.generateName_ = function() { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ff6e4f7 to
c5a497e
Compare
Sorry, something went wrong.
There was an error while loading. Please reload this page.
c5a497e to
7e2b679
Compare
|
Changes Unknown when pulling 7e2b679 on stephenplusplus:spp--1257 into * on GoogleCloudPlatform:master*. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@stephenplusplus this LGTM, do we want a review from a googler before going with it? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Let's just go with it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
question here: after I changed code from topic.subscribe('my-subscription', { ackDeadlineSeconds: 90, autoAck: true, interval: 30, reuseExisting: true }).then(...).catch(err => ...) to just remove the topic.subscribe('my-subscription', { ackDeadlineSeconds: 90, autoAck: true, interval: 30, }).then(...).catch(err => { console.error(err); }) why it ran into catch error clause? fail to subscribe: { Error: Resource already exists in the project (resource=subscriber-name). at /node_modules/grpc/src/node/src/client.js:434:17 code: 409, metadata: Metadata { _internal_repr: { 'google.rpc.debuginfo-bin': [ Buffer [ 67, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I tried with the following code and couldn't reproduce using the latest @google-cloud/pubsub: 'use strict' var pubsub = require('@google-cloud/pubsub')() var topic = pubsub.topic('stephen-topic') topic.get({ autoCreate: true }) .then(() => { return topic.subscribe('my-new-subscription', { ackDeadlineSeconds: 90, autoAck: true, interval: 30 }) }) .then(console.log) // fires .catch(console.log) // does not Can you try this code, modifying only the topic name? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Question -- if you use an auto-generated subscription name, won't it create a bunch of these every time you start up a new listener? And if the listeners don't cleanly delete the subscription on shutdown, won't those "randomly named" subscriptions still exist but not be drained, queueing up any and all messages on the topic for whatever the max is (7 days I think?) until they're eventually shut down in 30 days? And if it does that, would that affect my GCP quota? Or is the idea here that you must gracefully shut down and delete the unnamed subscription? I'm in a situation where I need my node process to just be one of many listeners to a topic and notify any users connected over a websocket if a message comes across that interests them. What's my best way to ephemerally subscribe to a topic without creating a long-lasting subscription? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Indeed, it does generate new subs for the topic (there is a cap of 10,000 subs per topics I believe) In my case, I just automatically clean up previously generated subscription before subscribing to the topic : Not very pretty, but it does the job :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Be careful doing this. At least for me the point of the broadcast model is that you can have multiple listeners at the same time... Be careful that you don't delete another instance's' subscription that is still running. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Yes, good point @rhagigi . In my case, I run this before deploying, so the new subs get re-created once the instances start. There might be a small risk but I don't know any other options. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
What I ended up doing was at least attempting to clean up the subscription
and delete it during shut down, assuming a proper clean application shut
down. If some slip through the cracks, no big deal, they'll get autodeleted
after inactivity for an amount of time, but at least under ideal
circumstances it should prevent the subscriptions for ballooning on every
single deploy to every machine.
…On Tue, Apr 25, 2017, 6:09 PM fab-1 ***@***.***> wrote:
Yes, good point @rhagigi <https://github.com/rhagigi> . In my case, I run
this before deploying, so the new instances get re-created once the
instances start. There might be a small risk but I don't know any other
options.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1799 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABmFIkLhZ3Uop1kYEtgY3eRUMo7HhvO3ks5rzm77gaJpZM4K0Ub8>
.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@google-cloud/paginator](https://togithub.com/googleapis/nodejs-paginator) | [`^4.0.1` -> `^5.0.0`](https://renovatebot.com/diffs/npm/@google-cloud%2fpaginator/4.0.1/5.0.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>googleapis/nodejs-paginator (@​google-cloud/paginator)</summary> ### [`v5.0.0`](https://togithub.com/googleapis/nodejs-paginator/blob/HEAD/CHANGELOG.md#500-2023-08-09) [Compare Source](https://togithub.com/googleapis/nodejs-paginator/compare/v4.0.1...v5.0.0) ##### ⚠ BREAKING CHANGES - update to Node 14 ([#​346](https://togithub.com/googleapis/nodejs-paginator/issues/346)) ##### Miscellaneous Chores - Update to Node 14 ([#​346](https://togithub.com/googleapis/nodejs-paginator/issues/346)) ([262ad70](https://togithub.com/googleapis/nodejs-paginator/commit/262ad70d3cc5e1aa8a67ece54c04920b24ceea09)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/googleapis/nodejs-pubsub). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40MC4zIiwidXBkYXRlZEluVmVyIjoiMzYuNDAuMyIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
🤖 I have created a release *beep* *boop* --- ## [4.0.1](https://togithub.com/googleapis/nodejs-pubsub/compare/v4.0.0...v4.0.1) (2023-08-11) ### Bug Fixes * **deps:** Update dependency @google-cloud/paginator to v5 ([#1799](https://togithub.com/googleapis/nodejs-pubsub/issues/1799)) ([3195d21](https://togithub.com/googleapis/nodejs-pubsub/commit/3195d21bf817cf10daa86b019532c9405dc42405)) * **deps:** Update dependency @google-cloud/precise-date to v4 ([#1803](https://togithub.com/googleapis/nodejs-pubsub/issues/1803)) ([2c22d67](https://togithub.com/googleapis/nodejs-pubsub/commit/2c22d67b0fbaf3409101a830ee0c5be002ed6c7b)) * **deps:** Update dependency @google-cloud/projectify to v4 ([#1800](https://togithub.com/googleapis/nodejs-pubsub/issues/1800)) ([5787d56](https://togithub.com/googleapis/nodejs-pubsub/commit/5787d56b95d46544bf8c59fe4bc4cb374bc53d0a)) * **deps:** Update dependency @google-cloud/promisify to v4 ([#1798](https://togithub.com/googleapis/nodejs-pubsub/issues/1798)) ([093c46b](https://togithub.com/googleapis/nodejs-pubsub/commit/093c46bd0a4713ad9702bde03eaa5e8b0acedb28)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [4.0.1](https://togithub.com/googleapis/nodejs-pubsub/compare/v4.0.0...v4.0.1) (2023-08-11) ### Bug Fixes * **deps:** Update dependency @google-cloud/paginator to v5 ([#1799](https://togithub.com/googleapis/nodejs-pubsub/issues/1799)) ([3195d21](https://togithub.com/googleapis/nodejs-pubsub/commit/3195d21bf817cf10daa86b019532c9405dc42405)) * **deps:** Update dependency @google-cloud/precise-date to v4 ([#1803](https://togithub.com/googleapis/nodejs-pubsub/issues/1803)) ([2c22d67](https://togithub.com/googleapis/nodejs-pubsub/commit/2c22d67b0fbaf3409101a830ee0c5be002ed6c7b)) * **deps:** Update dependency @google-cloud/projectify to v4 ([#1800](https://togithub.com/googleapis/nodejs-pubsub/issues/1800)) ([5787d56](https://togithub.com/googleapis/nodejs-pubsub/commit/5787d56b95d46544bf8c59fe4bc4cb374bc53d0a)) * **deps:** Update dependency @google-cloud/promisify to v4 ([#1798](https://togithub.com/googleapis/nodejs-pubsub/issues/1798)) ([093c46b](https://togithub.com/googleapis/nodejs-pubsub/commit/093c46bd0a4713ad9702bde03eaa5e8b0acedb28)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.