我是芹菜新手。我在芹菜上使用了三个队列,并且工作正常。我已经按照以下步骤运行芹菜:
celery worker -A bdjsms -l debug -Q "swiftapi,swiftsms,celery"
但是现在我需要再增加两个队列,并尝试如下运行celery:
celery worker -A bdjsms -l debug -Q "swiftapi,swiftsms,celery,bulksms,singlesms"
但这显示了错误
CRITICAL/MainProcess] Unrecoverable error: NotBoundError("Can't call method on Exchange not bound to a channel",)
添加两个队列并没有出什么问题。我已经使用python == 3.6.7,redis == 2.10.6和django-redis == 4.10.0。 追溯是
Traceback (most recent call last):
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/worker/worker.py", line 203, in start
self.blueprint.start(self)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 370, in start
return self.obj.start()
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 318, in start
blueprint.start(self)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start
step.start(parent)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/worker/consumer/tasks.py", line 37, in start
c.connection, on_decode_error=c.on_decode_error,
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/celery/app/amqp.py", line 302, in TaskConsumer
**kw
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/messaging.py", line 386, in __init__
self.revive(self.channel)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/messaging.py", line 407, in revive
self.declare()
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/messaging.py", line 420, in declare
queue.declare()
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/entity.py", line 604, in declare
self._create_exchange(nowait=nowait, channel=channel)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/entity.py", line 611, in _create_exchange
self.exchange.declare(nowait=nowait, channel=channel)
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/entity.py", line 182, in declare
return (channel or self.channel).exchange_declare(
File "/home/sparrow/.virtualenvs/envpython3.6/lib/python3.6/site-packages/kombu/abstract.py", line 119, in channel
type(self).__name__))
kombu.exceptions.NotBoundError: Can't call method on Exchange not bound to a channel