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

How to unsubscribe from streaming topic #1221

Open
terry-wilson opened this issue Feb 21, 2025 · 3 comments
Open

How to unsubscribe from streaming topic #1221

terry-wilson opened this issue Feb 21, 2025 · 3 comments

Comments

@terry-wilson
Copy link

I am trying to utilize the new pub/sub streaming capability and don't understand how to dynamically unsubscribe from a particular topic. In #1072, it states that "Daprd unsubscribes from the topic when the stream is closed" but I don't understand how the stream gets closed? I did take a look at the streaming pub/sub example but that doesn't seem to address unsubscribing either.

@artur-ciocanu
Copy link
Contributor

@terry-wilson thanks you for raising this issue. We will take a look and let you know.

@terry-wilson
Copy link
Author

@artur-ciocanu just wondering if there is any update on this ... given that you can dynamically subscribe to events, I would be very surprised if dynamically unsubscribing was somehow missed? I am hoping that I am just missing some basic understanding of how to do it.

@artur-ciocanu
Copy link
Contributor

@terry-wilson as far as I understood based on the implementation once you subscribe you get a Subscription back. Once you are done with your processing you can call subscription.close() and this should close the GRPC stream and ubsubscribe from the previously subscribed topic.

The API is still a little bit in flux. We are trying to come up with something that is a little more Project Reactor friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants