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

pubsub: list subscription configs, not just names #4559

Closed
mgabeler-lee-6rs opened this issue Aug 5, 2021 · 1 comment · Fixed by #4607
Closed

pubsub: list subscription configs, not just names #4559

mgabeler-lee-6rs opened this issue Aug 5, 2021 · 1 comment · Fixed by #4607
Assignees
Labels
api: pubsub Issues related to the Pub/Sub API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@mgabeler-lee-6rs
Copy link

Is your feature request related to a problem? Please describe.
I have a use case for listing subscriptions where I want to check information in the SubscriptionConfig object. The underlying gRPC ListSubscriptions call includes this information (or at least the portion I need -- I'm not entirely sure if it includes everything needed to form a SubscriptionConfig?), but the way it is exposed via the Subscriptions API on pubsub.Client and the resulting iterator it returns discards all this information (https://github.com/googleapis/google-cloud-go/blob/master/pubsub/subscription.go#L90-L96), and requires a second gRPC call for each subscription to re-acquire it!

Describe the solution you'd like
A couple possible solutions present themselves:

  1. A ListSubscriptionConfigs API on pubsub.Client that returns an iterator exposing SubscriptionConfigs instead of Subscriptions
  2. A NextConfig() method on SubscriptionIterator

Describe alternatives you've considered
The workaround of calling Config() on every Subscription returned works, but is inefficient

@mgabeler-lee-6rs mgabeler-lee-6rs added the triage me I really want to be triaged. label Aug 5, 2021
@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Aug 5, 2021
@hongalex hongalex added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Aug 13, 2021
@hongalex
Copy link
Member

Hey, thanks for reporting! This is quite strange behavior indeed, and even though you already noted the workaround, I think this could be more user friendly.

Just opened a PR to address this.

@hongalex hongalex reopened this Oct 6, 2021
@hongalex hongalex closed this as completed Nov 8, 2021
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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants