Note that there are some explanatory texts on larger screens.

plurals
  1. POdjango-celery consumer can not receive tasks
    primarykey
    data
    text
    <h2>Installation</h2> <p>I am using django(1.4) celery(3.0.13) with RabbitMQ(v3.0.4), the backend db is sqlite.</p> <p>Celery was installed by <code>pip install django-celery</code></p> <h2>Setting</h2> <p>In setting.py:</p> <pre><code># For django-celery import djcelery djcelery.setup_loader() BROKER_URL = 'amqp://user:pwd@sd5:5672/8086' ### and adding 'djcelery' to INSTALLED_APPS </code></pre> <h2>Running</h2> <p>After setup the database with <code>south</code>, I start rabbitmq-server and <code>manage.py celery worker --loglevel=debug</code></p> <p>I could see the connection was established:</p> <pre><code> -------------- celery@sd5 v3.0.16 (Chiastic Slide) ---- **** ----- --- * *** * -- [Configuration] -- * - **** --- . broker: amqp://utils@sd5:5672/8086 - ** ---------- . app: default:0x8a5106c (djcelery.loaders.DjangoLoader) - ** ---------- . concurrency: 2 (processes) - ** ---------- . events: OFF (enable -E to monitor this worker) - ** ---------- - *** --- * --- [Queues] -- ******* ---- . celery: exchange:celery(direct) binding:celery --- ***** ----- [Tasks] . celery.backend_cleanup . celery.chain . celery.chord . celery.chord_unlock . celery.chunks . celery.group . celery.map . celery.starmap . utils.weixin.tasks.celery_add [2013-03-19 19:50:00,460: WARNING/MainProcess] celery@sd5 ready. [2013-03-19 19:50:00,483: INFO/MainProcess] consumer: Connected to amqp://utils@sd5:5672/8086. [2013-03-19 19:50:00,498: DEBUG/MainProcess] consumer: Ready to accept tasks! </code></pre> <p>And in rabbit@sd5.log:</p> <pre><code>=INFO REPORT==== 19-Mar-2013::19:50:00 === accepting AMQP connection &lt;0.1655.0&gt; (127.0.0.1:50087 -&gt; 127.0.0.1:5672) </code></pre> <h2>Problem</h2> <p>Then I run my task <code>utils.weixin.tasks.celery_add</code> in <code>manage.py shell</code>:</p> <pre><code>&gt;&gt;&gt; from utils.weixin.tasks import celery_add &gt;&gt;&gt; result = celery_add.delay(1,3) &gt;&gt;&gt; result.ready() False &gt;&gt;&gt; result.get() </code></pre> <p><strong>hangup here forever...</strong></p> <p>And, nothing show up in the log of celery worker and log of rabbitmq, not any 'received task' etc.</p> <p>It seems that calling the task does not comunicate with worker.</p> <hr> <h2>Question</h2> <p>What should I do to find out what has been done incorrectly. How should I fix this?</p> <p>Appriciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload