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

Google::Cloud::PubSub::ReceivedMessage#subscription returns both subscription and stream #22438

Open
alanhala opened this issue Jun 21, 2023 · 2 comments
Assignees
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@alanhala
Copy link
Contributor

If you receive a message via streaming pull, ReceivedMessage#subscription returns the subscriber stream, meaning that if you want to grab the subscription name from it you have to do something like:

received_message.subscription.subscriber.subscription_name

But if you use the regular pull operation or the wait_for_messages method, ReceivedMessage#subscription now returns the actual subscription, meaning that the previous line crashes since subscription does not have a subscriber.

Is it possible that both return a subscription? So the streaming pull instead of returning a stream it returns a subscription as the name suggests.

@alanhala alanhala changed the title Google::Cloud::PubSub::ReceivedMessage#subscription returns both subscription and stream Google::Cloud::PubSub::ReceivedMessage#subscription returns both subscription and stream Jun 21, 2023
@alanhala
Copy link
Contributor Author

alanhala commented Jul 4, 2023

Any news here?

@NivedhaSenthil
Copy link
Member

This can be a breaking change for someone using it the other way. I agree it will be better to have the design consistent, will have to definitely consider this for the Pubsub v2 implementation.

@diptanshumittal diptanshumittal added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p3 Desirable enhancement or fix. May not be included in next release. labels Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants