-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Need a way to "delete" queue #1437
Comments
I posted some solution here to completely delete all queue keys, what can be helpful in unit tests, for instance. |
Thanks for the tips. We have a similar use case/requirement as described in #1323 We get an (infinite) series of message from a remote server, some of which are "related" to each other. I'm thinking of using Bull for queuing all related messages, and process them (say, in the order we received them), and when the last message in the related set has been processed, the (dynamically generated) queue is no longer needed and should be deleted. Otherwise, we will end up with linearly increasing number of unused queues in Redis over time (even if we can avoid name collision). |
Are you looking for something like auto-delete option in RabbitMQ? It automatically deletes queue when last consumer is shutdown. |
Not exactly. Messages arrive/are processed in a non-deterministic way. A queue can be empty while waiting for the next message. But, based on the messages we receive we know when/if we are done and we can dispose the queue. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This has been implemented recently: https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queueobliterate |
Description
It appears that queue state is maintained in the Redis backing store. And, if the same queue name is used, the Redis queue state seems to be re-used for the Bull queue. In many use cases, this may not be a desired behavior (and, it may not be practical use different queue names for each service run).
It'll be nice if we can completely "delete" the queue in the Redis through Bull API.
Minimal, Working Test code to reproduce the issue.
(An easy to reproduce test case will dramatically decrease the resolution time.)
API for deleting queues is missing: https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queue
Bull version
3.10.0
Additional information
The text was updated successfully, but these errors were encountered: