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

Ability to delete a consumer #567

Open
superlevure opened this issue Jun 10, 2024 · 1 comment
Open

Ability to delete a consumer #567

superlevure opened this issue Jun 10, 2024 · 1 comment
Assignees
Labels
accepted The defect or proposal as been accepted docs Improvements or additions to documentation

Comments

@superlevure
Copy link

superlevure commented Jun 10, 2024

Proposed change

I haven't found a way to delete a consumer using the Python SDK, the official documentation shows how to do it in Go using the DeleteConsumer method, but it doesn't seem to exist in nats.py.

Calling sub.unsubscribe() doesn't delete the consumer either.

Use case

My App is creating a one off pull based consumer and it needs to clean it after the work is done. I don't want to use an ephemeral consumer because I want to give it a name, and I need to explicitly control its lifecycle.

Contribution

If the proposal is accepted I'm willing to push a PR.

@superlevure superlevure added the proposal Enhancement idea or proposal label Jun 10, 2024
@superlevure
Copy link
Author

superlevure commented Jun 14, 2024

Actually my bad, there is a delete_consumer method exposed in JetStreamManager:

async def delete_consumer(self, stream: str, consumer: str) -> bool:

It is not documented in the SDK documentation though: https://nats-io.github.io/nats.py/search.html?q=delete_consumer&check_keywords=yes&area=default#

@caspervonb caspervonb added accepted The defect or proposal as been accepted docs Improvements or additions to documentation and removed proposal Enhancement idea or proposal labels Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The defect or proposal as been accepted docs Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants