Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final review for PubSub by Google PubSub team #487

Closed
ryanseys opened this issue Apr 6, 2015 · 16 comments
Closed

Final review for PubSub by Google PubSub team #487

ryanseys opened this issue Apr 6, 2015 · 16 comments
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@ryanseys
Copy link
Contributor

ryanseys commented Apr 6, 2015

Should we have this reviewed more?

@ryanseys ryanseys added the api: pubsub Issues related to the Pub/Sub API. label Apr 6, 2015
@pierre-b
Copy link

pierre-b commented May 1, 2015

Yes, the doc is quite a mess actually, looking at the code is essential.

Could you please update the doc, the message.id should be message.ackId https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.13.2/pubsub/subscription?method=ack

Thank you

@jgeewax jgeewax changed the title Final review for PubSub Final review for PubSub by Google PubSub team May 1, 2015
@jgeewax jgeewax added this to the Pub/Sub Stable milestone May 1, 2015
@ryanseys
Copy link
Contributor Author

ryanseys commented May 3, 2015

@pierre-b Hi thanks for your concerns. Is there any other specific issues you would like us to address?

@pierre-b
Copy link

pierre-b commented May 4, 2015

Hi @ryanseys , I noticed a 30sec average lag when I open a subscription and the first message arrives, then the others arrive directly. Is this an expected behavior ?

I also need to know how many messages are waiting in the subscription, to pop new workers or monitor the health of my system. Is it in the roadmap actually ?

Thank you

@jgeewax
Copy link
Contributor

jgeewax commented May 4, 2015

Hi @pierre-b: Can you put these in separate issues so we can track them individually?

@tmatsuo
Copy link
Contributor

tmatsuo commented May 12, 2015

I will look at the code this week.

@pierre-b
Copy link

Hi @jgeewax , forgot to tell you Ive opened separate issues.

@tmatsuo
Copy link
Contributor

tmatsuo commented May 16, 2015

Pubsub holds the project id, which prevents you from accessing resources in multiple projects.

https://github.com/GoogleCloudPlatform/gcloud-node/blob/master/lib/pubsub/index.js#L90

Is this expected?

@jgeewax
Copy link
Contributor

jgeewax commented May 16, 2015

Just to be clear, it seems to me that I could do:

var gcloud = require('gcloud');
var pubsub1 = gcloud.pubsub({projectId: 'project1'});
var pubsub2 = gcloud.pubsub({projectId: 'project2'});

right?

This would allow us to access resources across projects, no?

@tmatsuo
Copy link
Contributor

tmatsuo commented May 16, 2015

@jgeewax I hope you're right. I meant you can not access multiple projects unless creating multiple pubsub object.

However, I came up with a bad scenario.
I have 2 projects; project1 and project2.
I have 1 topic; topic1 in project1.
I have 1 subscription; subscription2 in project2, which subscribes to the topic1.

I don't think I can access to the subscription2 easily. It seems to me that the only way is to call pubsub.getSubscriptions() and iterate like:

var pubsub2 = gcloud.pubsub({projectId: 'project2'});
pubsub2.getSubscriptions(
  func(err, subscriptions, nextQuery, apiResponse) {
    // I don't come up with how to iterate the result easily
  }
)

Since if I do the following, the subscription object will have a wrong projectId:

var pubsub1 = gcloud.pubsub({projectId: 'project1'});
var topic1 = pubsub1.topic('topic1');
var sub2 = topic1.subscription('subscription2'); // sub2 will have 'project1', which is wrong

@tmatsuo tmatsuo closed this as completed May 16, 2015
@tmatsuo tmatsuo reopened this May 16, 2015
@tmatsuo
Copy link
Contributor

tmatsuo commented May 16, 2015

This is the biggest concern from me.

Also little bit worried about the performance. I would like to do performance comparison with the google-api-js-client, but never get time to do that.

@tmatsuo
Copy link
Contributor

tmatsuo commented May 16, 2015

Oh, maybe I can do the following?

var pubsub2 = gcloud.pubsub({projectId: 'project2'});
var sub2 = pubsub2.subscription('subscription2');

Then, that's fine.

@tmatsuo
Copy link
Contributor

tmatsuo commented May 17, 2015

Apparently, Pubsub object doesn't have subscription method. Can you add it?

@ryanseys
Copy link
Contributor Author

That would just create a reference to an existing subscription, we would also have to support pubsub#subscribe I believe that could take an optional topic object.

@jgeewax
Copy link
Contributor

jgeewax commented May 18, 2015

Re performance: that is actively not a goal for this right now. P(usability) >> P(performance). That isn't to say that performance will be ignored, but it's lower priority than usability.


I have 2 projects; project1 and project2.
I have 1 topic; topic1 in project1.
I have 1 subscription; subscription2 in project2, which subscribes to the topic1.

Is it reasonable to create a subscription to a topic from a different project?

What I read in the docs (https://cloud.google.com/pubsub/reference/rest/v1beta2/projects/subscriptions/create) is that Subscription.create accepts:

  • name=projects//subscriptions/ (ie, the name includes the product ID and the subscription name
  • "topic": string, (ie, you specify which topic to subscribe to)
  • other config stuff

If that's the case, without topics being globally unique, is there any possible way to specify a topic from another project? Does "topic" (string) take the form /projects/project-id/topics/topic-name ?

@tmatsuo
Copy link
Contributor

tmatsuo commented May 18, 2015

Is it reasonable to create a subscription to a topic from a different project?

Yes, it's totally reasonable.

Does "topic" (string) take the form /projects/project-id/topics/topic-name ?

To be precise, it's "projects/project-id/topics/topic-name". It's far better than a situation where resource names are in the global namespace.

@stephenplusplus
Copy link
Contributor

Going to close this out, as I believe we have fixed everything addressed in this issue, and will continue to tackle things one at a time in other issues. Feel free to reopen if I missed something.

sofisl pushed a commit that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants