Worker pools and multi-tenant queues with RabbitMQ

前端 未结 4 1485
悲&欢浪女
悲&欢浪女 2021-02-05 14:28

I work on a web application that is a multi-tenant cloud based application (lots of clients, each with their own separate \"environment\", but all on shared sets of hardware) an

4条回答
  •  太阳男子
    2021-02-05 14:47

    Workers are assigned 0+ queues, not exchanges.

    The logic for which tasks will be taken from which queues for each worker is implemented in the class indicated via CELERYD_CONSUMER, which is by default celery.worker.consumer.Consumer.

    You can create a custom consumer class ro implements whatever logic you like. The hard part will be deciding the details ofthe "fairness" algorithm you want to use; but once you've decided that, you can implement it be creating a custom consumer class and assigning that to appropriate workers.

提交回复
热议问题