Each Job in my system belongs to a specific userid and can be put in rabbitmq from multiple sources. My requirements:
- No more than 1 job should be running per user at any given time.
- Jobs for other users should not experience any delay because of job piling up for a specific user.
- Each Job should be executed at least once. Each Job will have a max retries count and is re-inserted in queue (or probably delayed) with a delay if fails.
- Maintaining Sequence of Jobs (per user) is desirable but not compulsory.
- Jobs should probably be persisted, as I need them executing atleast once. There is no expiry time of jobs.
- Any of the workers should be able to run jobs for any of the user.
With these requirements, I think maintaining a single queue for each individual user makes sense. I would also need all the workers watching all user queues and execute job for user, whose job is currently not running anywhere (ie, no more than 1 job per user)
Would this solution work using RabbitMQ in a cluster setup? Since the number of queues would be large, I am not sure each worker watching every user queue would cause significant overhead or not. Any help is appreciated.