Uh oh!
There was an error while loading. Please reload this page.
Add option to automatically create a topic and re-use a subscription. - #465
Add option to automatically create a topic and re-use a subscription.#465theacodes wants to merge 6 commits into
Conversation
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
* Adding simple example of using autoCreate. * Putting string comparison last.
theacodes
commented
Mar 25, 2015
Fixed the lint issues and updated after the review. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ryanseys
commented
Mar 27, 2015
Overall LGTM. One stylistic nitpick: we add spaces between our keys in an object. Like this: |
stephenplusplus
commented
Mar 27, 2015
LGTM. Thanks for doing this! |
ryanseys
commented
Mar 27, 2015
Merged in 3f8f60f |
matthewmueller
commented
Aug 20, 2016
I wasn't able to get this working from the example you provided. Here's my code: constPubSub=require('@google-cloud/pubsub')constpubsub=PubSub({projectId: require('./cred.json').project_id,credentials: require('./creds.json')})consttopic=pubsub.topic('hi-there',{autoCreate: true})topic.publish({data: 'New message!'},function(err){console.log(err)});
|
stephenplusplus
commented
Aug 22, 2016
A similar example came up on StackOverflow (http://stackoverflow.com/questions/38864043/gcloud-check-if-a-topic-exist-and-ability-to-reuse-the-topic), so I'll quote my response there: I believe the problem you'll run into is that if a message is published to a topic that doesn't exist, it is immediately dropped. So, it won't hang around and wait for a subscription to be created; it'll just disappear. However, gcloud-node does have methods that will create a topic if necessary: vartopic=pubsub.topic('topic-that-maybe-exists');topic.get({autoCreate: true},function(err,topic){// topic.publish(...});In fact, almost all gcloud-node objects have the get method that will work the same way as above, i.e. a Pub/Sub subscription or a Storage bucket or a BigQuery dataset, etc. Here's a link to the topic.get() method in the docs: https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.37.0/pubsub/topic?method=get |
gustawdaniel-acaisoft
commented
Dec 15, 2021
I have error |
gustawdaniel-acaisoft
commented
Dec 15, 2021
these are publish options |
Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: gcf-owl-bot[bot] <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ### [3.2.4](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.3...v3.2.4) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#464](https://www.github.com/googleapis/nodejs-os-login/issues/464)) ([67847c3](https://www.github.com/googleapis/nodejs-os-login/commit/67847c3d7f8328c797daf93a8880025b3fdbc763)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ### [3.2.4](https://www.github.com/googleapis/nodejs-os-login/compare/v3.2.3...v3.2.4) (2021-07-12) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#464](https://www.github.com/googleapis/nodejs-os-login/issues/464)) ([67847c3](https://www.github.com/googleapis/nodejs-os-login/commit/67847c3d7f8328c797daf93a8880025b3fdbc763)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@388e10f Source-Link: googleapis/synthtool@d82decc
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/5b03461e-47c0-40e8-a8ad-c465ee146cc5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@388e10f Source-Link: googleapis/synthtool@d82decc
The value in the example five lines up is 'world', so this line should match that.
The value in the example five lines up is 'world', so this line should match that.
This adds
autoCreatetopubsub.topic:And
reuseExistingtotopic.subscribe:Combined, these two features completely eliminate any bootstrapping code/steps required for the Getting Started on GCP sample.