Repository navigation
Trying to subcribe pubsub topic but not getting anything #679
Description
Activity
What exactly is going on in
keyFilename: KeyFile(Buffer format)?keyFilenameshould be a path to a.jsonfile you get via the Cloud Console (see http://googlecloudplatform.github.io/gcloud-node/#/authorization for more on that).Can you also clarify what you mean by "not getting callback of subscription"? You mean the callback is not being executed? Did you try adding
console.log(err)inside each of the callbacks to see what's happening?- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.
on Jun 19, 2015 Also -- this might be better asked over on StackOverflow unless it looks like a bug with
gcloud.pubsub.Hi jgeewax,
Yes i am using keyFilename as .json file of cloud console.I am not getting callback of subscription means i added console.log(err) and console.log(subscription).But i didn't get any error or subscription log.
Same thing happened while creating topic.I didn't get error log also.
So is that topic is created? and how can i subscribe to that topic ?You're saying that the callback isn't getting executed at all?
As in, running the following prints out nothing?
var gcloud = require('gcloud'); var pubsub = gcloud.pubsub({ projectId: 'purple-spaceship-123', // or whatever your project ID is. keyFilename: '~/keyfile.json' // or the path to your keyfile }); pubsub.createTopic('topicName', function(err, topic) { console.log('Response was', err, topic); });
Hi jgeewax ,
Yes.Callback isn't get executed at all.Yes above code prints nothing.
- Can you put console.log statements around the calls to see what's up? In short... Even if there is an error, it should execute the callback with the error, the only reason for it not to run at all is if there is an error in your code elsewhere preventing the createTopic method from being executed at all....
Hi jgeewax,
Thanks i have created topic successfully. I want to create watch on that pub/sub topic.For that i am using rest request as
request_Req.post({ url:'https://www.googleapis.com/gmail/v1/users/me/watch', headers:{ 'content-type': 'application/json', 'Authorization': 'Bearer '+ access_token, }, scope : [ 'https://mail.google.com/' ], 'body': JSON.stringify({ 'topicName' : "/projects/ProjectId/topics/TopicId", 'labelIds' : ["INBOX"] }); }),function(error, resp, body){ });
But after executing this code i am getting error as sending test message to Cloud
PubSub/projects/ProjectID/topics/TopicId : Resource not found(resource=TopicId)Hi @AP25 ,
Did you figure out what the problem was ? (So that others reading this could solve it themselves?)
It looks like your next question isn't really about this library, so you might want to take it over to Stack Overflow to see if someone can help out.
I'm going to resolve this issue (but still would love to hear how you fixed the first issue!), feel free to re-open if I misunderstood and this is either a bug or a question about gcloud-node.
- added a commit that references this issue
on Nov 11, 2022 11 remaining items
- added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 17, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Hi,
I am trying to subscribe created topic on pubsub for that i am using
But using this i am not getting callback of subscription. Is anything missing in this request?
Thanks in advance!!!