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

Need a way to "delete" queue #1437

Closed
realharry opened this issue Aug 21, 2019 · 6 comments
Closed

Need a way to "delete" queue #1437

realharry opened this issue Aug 21, 2019 · 6 comments

Comments

@realharry
Copy link

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

@stansv
Copy link
Contributor

stansv commented Aug 21, 2019

I posted some solution here to completely delete all queue keys, what can be helpful in unit tests, for instance.

@realharry
Copy link
Author

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).

@stansv
Copy link
Contributor

stansv commented Aug 21, 2019

Are you looking for something like auto-delete option in RabbitMQ? It automatically deletes queue when last consumer is shutdown.

@realharry
Copy link
Author

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.

@stale
Copy link

stale bot commented Jul 12, 2021

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.

@stale stale bot added the wontfix label Jul 12, 2021
@manast
Copy link
Member

manast commented Jul 13, 2021

This has been implemented recently: https://github.com/OptimalBits/bull/blob/develop/REFERENCE.md#queueobliterate

@manast manast closed this as completed Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants