V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
sycandy
V2EX  ›  Python

celery+rabbitmq 每次都会生成一个新的队列

  •  
  •   sycandy · 2017-05-08 16:16:14 +08:00 · 2400 次点击
    这是一个创建于 2538 天前的主题,其中的信息可能已经有所发展或是发生改变。
    #abmp.py:

    from celery import Celery


    app = Celery('abmp',
    backend='amqp://guest@localhost',
    broker='amqp://guest@localhost'
    )

    @app.task(bind=True)
    def add(self, a, b):
    return a + b

    # execute_test.py
    from abmp import add
    result = add.apply_async(
    args=(5,7),
    queue='push_tasks',
    exchange='push_tasks',
    routing_key='push_tasks'
    )

    #后台执行
    celery -A abmp worker -E -Q push_tasks -l info

    最后到 rabbitmq 后台查看,发现每次执行 execute_test.py 都生成了一个新的 queue,而不是把任务丢给 push_tasks 中。
    4 条回复    2019-02-14 16:57:54 +08:00
    sycandy
        1
    sycandy  
    OP
       2017-05-08 16:16:38 +08:00
    是我配置错误了吗
    julyclyde
        2
    julyclyde  
       2017-05-08 20:38:36 +08:00
    新的叫啥
    sycandy
        3
    sycandy  
    OP
       2017-05-09 09:56:07 +08:00
    @julyclyde 一个随机的队列名,看着像 UUID 的字符串。
    lxerxa
        4
    lxerxa  
       2019-02-14 16:57:54 +08:00
    lz 后来怎么解决了?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2917 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 03:49 · PVG 11:49 · LAX 20:49 · JFK 23:49
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.