CELERY: The AMQP result backend is scheduled for deprecation in version 4.0 and removal in version v5.0.Please use RPC backend or a persistent backend

celery升级到4.x之后运行抛出如下异常:

/anaconda/anaconda3/lib/python3.6/site-packages/celery/backends/amqp.py:67: CPendingDeprecationWarning: 
    The AMQP result backend is scheduled for deprecation in     version 4.0 and removal in version v5.0.     Please use RPC backend or a persistent backend.
  alternative='Please use RPC backend or a persistent backend.')

原因解析:
在celery 4.0中 rabbitmq 配置result_backbend方式变了:
以前是跟broker一样:
result_backend = 'amqp://guest:guest@localhost:5672//'
现在对应的是rpc配置:
result_backend = 'rpc://'

参考链接:
http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-event_queue_prefix

猜你喜欢

转载自www.cnblogs.com/cord/p/9252775.html
今日推荐