From a9c1316b15055b67ee3c38d294461fa82ed6d2b5 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Wed, 27 Jan 2010 11:35:54 +0100 Subject: [PATCH] Fixed this really ugly bug: After renaming consumer routing_key to binding_key we still need to rewrite it back to routing_key when we use it as an option in carrot. This fixes the bug related to http://stackoverflow.com/questions/2141083/rabbitmq-celery-with-django-hangs-on-delay-ready-etc-no-useful-log-info --- celery/messaging.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/celery/messaging.py b/celery/messaging.py index b742a97d146..d57a91c9829 100644 --- a/celery/messaging.py +++ b/celery/messaging.py @@ -151,4 +151,10 @@ def get_consumer_set(connection, queues=None, **options): """ queues = queues or conf.routing_table - return ConsumerSet(connection, from_dict=queues, **options) + cset = ConsumerSet(connection) + for queue_name, queue_options in queues.items(): + queue_options["routing_key"] = queue_options.pop("binding_key", None) + consumer = Consumer(connection, queue=queue_name, + backend=cset.backend, **queue_options) + cset.consumers.append(consumer) + return cset