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

Synchronous Pull #372

Open
antonmry opened this issue Nov 17, 2020 · 1 comment
Open

Synchronous Pull #372

antonmry opened this issue Nov 17, 2020 · 1 comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite API. 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

@antonmry
Copy link

Based in some comments in this PR with @dpcollins-google, I opened this Feature request. Pub/sub provides an option to retrieve records synchronously: https://cloud.google.com/pubsub/docs/reference/rpc/google.pubsub.v1#pullrequest

It isn't the recommended way but it works well in some scenarios.

Pub/Sub Lite doesn't have this feature so if you need to do polling, some buffer is needed in the middle to simulate that behavior. That already happen in the PubSub Lite kafka library and the Apache Beam connector. It will happen again in the Source kafka connector.

To avoid to repeat the same workaround in each place, it would be nice to provide that API as part of the Java SDK. It would help also to clients moving from PubSub Lite to PubSub and viceversa.

@product-auto-label product-auto-label bot added the api: pubsublite Issues related to the googleapis/java-pubsublite API. label Nov 17, 2020
@dpcollins-google
Copy link
Collaborator

This code is actually not duplicated, just not exposed to end users. Both of these classes use BufferingPullSubscriber here https://github.com/googleapis/java-pubsublite/blob/master/google-cloud-pubsublite/src/main/java/com/google/cloud/pubsublite/internal/BufferingPullSubscriber.java which implements this pattern. Both beam and kafka need explicit access to the partition numbers however, so a Cloud Pub/Sub Pull emulation layer wouldn't work for either of these.

That being said, we will consider this feature request for the future (exposing a public api that looks like Cloud Pub/Sub pull in the client) because it could be independently useful to other users.

@dpcollins-google dpcollins-google 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 Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsublite Issues related to the googleapis/java-pubsublite API. 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

2 participants