Open superlevure opened 5 months ago
Actually my bad, there is a delete_consumer
method exposed in JetStreamManager
: https://github.com/nats-io/nats.py/blob/fe305ac92b9e1d8a762c9eec2a6c4ab98f7500be/nats/js/manager.py#L226
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#
Hey - I can update the docs for this!
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 innats.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.