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

feature-request: can a Queue has state like 'pause' or 'running' #366

Open
elvizlai opened this issue Dec 20, 2024 · 4 comments
Open

feature-request: can a Queue has state like 'pause' or 'running' #366

elvizlai opened this issue Dec 20, 2024 · 4 comments

Comments

@elvizlai
Copy link
Contributor

Sometimes, the queue needs state control, especially for consumers/subscribers.
Typically, such states (running, pause) do not affect the producer. However, there could also be special states like "stopped" to manage production and pushing.

Is it possible for us to add this state control?

@ChuckHend
Copy link
Member

Something like this should be possible.

One way could be through the use of roles and priveldges. For example, have separate roles created for the consumers and producers. Then control read and write access by changing those priveldges. Something like REVOKE INSERT, UPDATE, DELETE, TRUNCATE ON ALL TABLES IN SCHEMA pgmq FROM pgmq_consumers;. I think would be close to pausing the queue for the consumers. This method wouldn't need any changes to the pgmq project and could be tailored to your specific use case.

There's probably something that could be built into the pgmq project directly too, but I'll need to think about it a bit more.

@v0idpwn
Copy link
Collaborator

v0idpwn commented Dec 26, 2024

But why? I understand the need to pause queues if you have a push model, but for a pull model, it doesn't seem necessary.

@elvizlai
Copy link
Contributor Author

For example: the consumer downstream has something wrong or uncontrolled behavior, need just stop consuming but not all whole application.
Maybe we can check how other MQ did this?

@v0idpwn
Copy link
Collaborator

v0idpwn commented Jan 4, 2025

I'm not aware of any pull-based MQ solution that has this feature.

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

3 participants