kombu

Django / Celery / Kombu worker error: Received and deleted unknown message. Wrong destination?

北城余情 提交于 2021-02-08 08:35:17
问题 It seems as though messages are not getting put onto the queue properly. I'm using Django with Celery and Kombu to make use of Django's own database as a Broker Backend. All I need is a very simple Pub/Sub setup. It will eventually deploy to Heroku, so I'm using foreman to run locally. Here is the relevant code and info: pip freeze Django==1.4.2 celery==3.0.15 django-celery==3.0.11 kombu==2.5.6 Procfile web: source bin/activate; python manage.py run_gunicorn -b 0.0.0.0:$PORT -w 4; python

Can anyone please tell me what are the differences between pika and kombu messaging library in python?

杀马特。学长 韩版系。学妹 提交于 2020-12-30 04:53:32
问题 I want to use messaging library in my application to interact with rabbitmq. Can anyone please explain the differences between pika and kombu library? 回答1: Kombu and pika are two different python libraries that are fundamentally serving the same purpose: publishing and consuming messages to/from a message broker. Kombu has a higher level of abstraction than pika. Pika only supports AMQP 0.9.1 protocol while Kombu can support other transports (such as Redis). More generally, Kombu is more

Celery: Interact/Communicate with a running task

家住魔仙堡 提交于 2020-02-22 08:25:45
问题 A related (albeit not identical) question appears here: Interact with celery ongoing task It's easy to start a task and get its unique ID: async_result = my_task.delay() task_id = async_result.task_id It's easy to broadcast a message that will reach a custom command in the worker: my_celery_app.control.broadcast('custom_command', arguments= {'id': task_id}) The problem arises that the worker is started in the form of a small process tree formed of one supervisor and a number of children. The

Celery: Interact/Communicate with a running task

北慕城南 提交于 2020-02-22 08:24:03
问题 A related (albeit not identical) question appears here: Interact with celery ongoing task It's easy to start a task and get its unique ID: async_result = my_task.delay() task_id = async_result.task_id It's easy to broadcast a message that will reach a custom command in the worker: my_celery_app.control.broadcast('custom_command', arguments= {'id': task_id}) The problem arises that the worker is started in the form of a small process tree formed of one supervisor and a number of children. The

Celery, kombu and django - import error

痞子三分冷 提交于 2020-01-24 04:10:12
问题 I am running an application with django, and I wanted to use celery to make some scheduled tasks. According to the oficial docs, in my settings.py file I set the broker transport BROKER_URL = 'django://' and added kombu.transport.django to installed apps INSTALLED_APPS = ( .... 'kombu.transport.django', ....) However, when I try to sync the database, with python manage.py syncdb , i get the following error: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from

Getting ImportError: cannot import name OrderedDict

南笙酒味 提交于 2019-12-24 02:02:00
问题 I am getting the error ImportError: cannot import name OrderedDict while installing a server locally on my ubuntu 14.04 machine. I have tried installing ordereddict manually and also tried upgrading kombu but it is still giving the error.The full traceback is added below- rishav@Swastik:~/open-event-orga-server$ sudo python create_db.py Traceback (most recent call last): File "create_db.py", line 5, in from app import current_app File "/home/rishav/open-event-orga-server/app/ init .py", line

Getting ImportError: cannot import name OrderedDict

血红的双手。 提交于 2019-12-24 02:01:05
问题 I am getting the error ImportError: cannot import name OrderedDict while installing a server locally on my ubuntu 14.04 machine. I have tried installing ordereddict manually and also tried upgrading kombu but it is still giving the error.The full traceback is added below- rishav@Swastik:~/open-event-orga-server$ sudo python create_db.py Traceback (most recent call last): File "create_db.py", line 5, in from app import current_app File "/home/rishav/open-event-orga-server/app/ init .py", line

Django & Celery — Routing problems

旧街凉风 提交于 2019-12-20 08:51:25
问题 I'm using Django and Celery and I'm trying to setup routing to multiple queues. When I specify a task's routing_key and exchange (either in the task decorator or using apply_async() ), the task isn't added to the broker (which is Kombu connecting to my MySQL database). If I specify the queue name in the task decorator (which will mean the routing key is ignored), the task works fine. It appears to be a problem with the routing/exchange setup. Any idea what the problem could be? Here's the

In-Memory broker for celery unit tests

拟墨画扇 提交于 2019-12-18 10:23:08
问题 I have a REST API written in Django, with and endpoint that queues a celery task when posting to it. The response contains the task id which I'd like to use to test that the task is created and get the result. So, I'd like to do something like: def test_async_job(): response = self.client.post("/api/jobs/", some_test_data, format="json") task_id = response.data['task_id'] result = my_task.AsyncResult(task_id).get() self.assertEquals(result, ...) I obviously don't want to have to run a celery

Kombu/Celery messaging

这一生的挚爱 提交于 2019-12-12 03:37:14
问题 I have a simple application that sends & receives messages, kombu, and uses Celery to task the message. Kombu alon, I can receive the message properly. when I send "Hello", kombu receives "Hello". But when I added the task, what kombu receives is the task ID of the celery. My purpose for this project is so that I can schedule when to send and receive messages, hence Celery. What I would like to know is why is kombu receiving the task id instead of the sent message? I have searched and