diff --git a/Changelog b/Changelog index aba85bf4..9399a04a 100644 --- a/Changelog +++ b/Changelog @@ -21,6 +21,12 @@ * Redis did not respect QoS settings. +* consumer_tag argument to ``Queue.consume`` can't be :const:`None` + (Issue #21). + + A None value is now automatically converted to empty string. + An empty string will make the server generate a unique tag. + * BrokerConnection now supports a ``transport_options`` argument. This can be used to pass additional arguments to transports. diff --git a/kombu/entity.py b/kombu/entity.py index 6f30a1aa..aed94f7a 100644 --- a/kombu/entity.py +++ b/kombu/entity.py @@ -415,7 +415,7 @@ class Queue(MaybeChannelBound): return _SYN(self.channel.queue_purge, queue=self.name, nowait=nowait) or 0 - def consume(self, consumer_tag=None, callback=None, no_ack=None, + def consume(self, consumer_tag='', callback=None, no_ack=None, nowait=False): """Start a queue consumer. @@ -437,7 +437,7 @@ class Queue(MaybeChannelBound): """ return self.channel.basic_consume(queue=self.name, no_ack=no_ack, - consumer_tag=consumer_tag, + consumer_tag=consumer_tag or '', callback=callback, nowait=nowait)