I am writing a mailing-list manager using Django, Celery, and RabbitMQ. When a message comes in, a task is executed for each recipient. All tasks go to a single queue, and one or more workers consume tasks from the queue, constructing the email messages and sending them.
The single queue causes a fairness problem: if a message comes in to a large mailing list, a large number of tasks are added to the queue, and other messages cannot get through to other, smaller mailing lists until all the messages to the large list have been sent. How can I find a way around this?
Conceptually, a solution would be to create a queue for each mailing list and have the worker(s) consume tasks from the various queue round robin. Is this possible in Celery, given that I need to be able to create new mailing lists dynamically? I have not seen functionality for creating queues dynamically or for making the worker(s) consume from new queues.