sonus21 / rqueue

Rqueue aka Redis Queue [Task Queue, Message Broker] for Spring framework
https://sonus21.github.io/rqueue
Apache License 2.0
337 stars 57 forks source link

Service-Level Concurrency Control #217

Closed pavelnemirovsky closed 4 months ago

pavelnemirovsky commented 7 months ago

Is your feature request related to a problem? Please describe. Imagine I have a dynamic pool of containers that fluctuate in number. I need to guarantee that tasks from the queue are executed with consistent concurrency across the entire service, rather than on a per-application basis.

Describe the solution you'd like I would like Rqueue to monitor the total number of tasks executed on a per-queue basis and ensure that the number of tasks executed concurrently aligns with the predefined limit for each queue (at the service level).

Describe alternatives you've considered Create a specialized concurrency controller to oversee the total number of tasks executed across the service. For example, an implementation that utilizes Redis INCR/DECR commands.

Additional context I apologize for opening a feature request; perhaps I didn't understand how to implement it based on the provided example. Thank you for your assistance.

sonus21 commented 7 months ago

Hi @pavelnemirovsky Its very simple, you can employ RateLimiter at queue level using middleware