我需要一个django-芹菜守护进程来监听特定的rabbitmq通道
In fact I have few django applications with celery tasks. I need each task to be executed within particular channel so that I can control the load. For example I may have 3 servers listen to channel_for_app_1
and two to channel_for_app_2
. My question is how can I run celery daemon and specify the channel? Any other ways to do that?
事实上,我很少有django应用程序用于芹菜任务。我需要在特定通道内执行每个任务,这样我就可以控制负载。例如,我可能有3台服务器监听channel_for_app_1, 2台监听channel_for_app_2。我的问题是如何运行芹菜守护进程并指定通道?还有其他方法吗?
2 个解决方案
#1
1
Please review this page: http://docs.celeryproject.org/en/latest/userguide/routing.html.
请查看此页面:http://docs.celeryproject.org/en/latest/userguide/routing.html。
Your celery just should start with -Q, --queue settings, which define which queue will be used for fetching tasks
芹菜应该以-Q -queue设置开头,该设置定义用于获取任务的队列