diff options
author | Ask Solem <ask@celeryproject.org> | 2011-01-28 22:45:20 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2011-01-28 22:45:20 +0100 |
commit | 572e709f9c44f48f50b4eea525d65777e01cc6f4 (patch) | |
tree | 942deadbd7284d38945cee6af43159edacc186d5 | |
parent | a9b53e89bce2f03f176e154b930e99f3fe125e0d (diff) | |
download | kombu-572e709f9c44f48f50b4eea525d65777e01cc6f4.tar.gz |
Documentation fixes
-rw-r--r-- | kombu/messaging.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kombu/messaging.py b/kombu/messaging.py index 3ab14103..48b814e4 100644 --- a/kombu/messaging.py +++ b/kombu/messaging.py @@ -29,16 +29,17 @@ class Producer(object): :keyword auto_declare: Automatically declare the exchange at instantiation. Default is :const:`True`. :keyword on_return: Callback to call for undeliverable messages, - when the `mandatory` or `imediate` arguments to + when the `mandatory` or `immediate` arguments to :meth:`publish` is used. This callback needs the following signature: `(exception, exchange, routing_key, message)`. + Note that the producer needs to drain events to use this feature. """ #: The connection channel used. channel = None #: Default exchange. - exchange = Exchange("") + exchange = None # Default routing key. routing_key = "" @@ -62,6 +63,8 @@ class Producer(object): on_return=None): self.channel = channel self.exchange = exchange or self.exchange + if self.exchange is None: + self.exchange = Exchange("") self.routing_key = routing_key or self.routing_key self.serializer = serializer or self.serializer self.compression = compression or self.compression |