Browse Source

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

Ask Solem 15 years ago
parent
commit
a9c1316b15
1 changed files with 7 additions and 1 deletions
  1. 7 1
      celery/messaging.py

+ 7 - 1
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