From ad30cddd34067612665119c68bcd438f99f30198 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Mon, 15 Aug 2011 12:40:15 +0100 Subject: [PATCH] exchange argument to publish can now be an Exchange --- kombu/messaging.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kombu/messaging.py b/kombu/messaging.py index cf3036e4..d6f77afa 100644 --- a/kombu/messaging.py +++ b/kombu/messaging.py @@ -120,6 +120,9 @@ class Producer(object): if compression is None: compression = self.compression + if isinstance(exchange, Exchange): + exchange = exchange.name + body, content_type, content_encoding = self._prepare( body, serializer, content_type, content_encoding, compression, headers) @@ -281,6 +284,8 @@ class Consumer(object): """Register consumer on server. """ + if not self.queues: + return if no_ack is None: no_ack = self.no_ack H, T = self.queues[:-1], self.queues[-1]