V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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 · May 8, 2017 · 2803 views
    This topic created in 3277 days ago, the information mentioned may be changed or developed.
    #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 replies    2019-02-14 16:57:54 +08:00
    sycandy
        1
    sycandy  
    OP
       May 8, 2017
    是我配置错误了吗
    julyclyde
        2
    julyclyde  
       May 8, 2017
    新的叫啥
    sycandy
        3
    sycandy  
    OP
       May 9, 2017
    @julyclyde 一个随机的队列名,看着像 UUID 的字符串。
    lxerxa
        4
    lxerxa  
       Feb 14, 2019
    lz 后来怎么解决了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5658 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 07:23 · PVG 15:23 · LAX 00:23 · JFK 03:23
    ♥ Do have faith in what you're doing.