I'm struggling to arrive at a design that fits our situation just right, and wonder if I'm approaching it wrong.
We want to use RabbitMQ as a task queue. The tasks take a long time, from one second to two minutes, with an average time of around, say, 15 seconds. The workers use a lot of resources, and we can only have a handful running concurrently; a few will be slower than the rest, and can have lower consumer priority.
Some jobs an end-user will be waiting on, and arrive a few per minute; they can come across with a routing key ("app.job.sync") and/or a priority that distinguishes them. The rest of the jobs tend to come in large batches—as many as a couple hundred at a time.
Priority queues help, but leave too much likelihood that all workers will have become newly occupied with two-minute jobs when a "sync" job request comes in at the front of the line.
I thought I could have a couple workers consuming only from a sync queue, and all the rest pulling from both the sync and the background queue. The only problem with this is that Rabbit will feed a consumer subscribed to multiple queues alternately from each queue. Ideally it would somehow know to drain the sync queue before sending anything from the other one to a dual-subscribed consumer. (Message priority has no effect across queues.)
Thank you for your time and any ideas you can offer!