diff --git a/CHANGELOG.md b/CHANGELOG.md index 845d1691e63472e2119f35d9da49ab4b247790b7..169ff0099fc176a080aeba437cea992be66c1e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ v2.0.1 ====== * removed extra logging from argumentify +* user will be notified upon declaring an auto-delete durable exchange v2.0.0 ====== diff --git a/coolamqp/objects.py b/coolamqp/objects.py index aae99be4a95ba9ee53a1d1f61c2e09dffbf5890b..ac92a97cd78d6b3e57677880d5f62141ae75f563 100644 --- a/coolamqp/objects.py +++ b/coolamqp/objects.py @@ -37,7 +37,7 @@ class MessageProperties(BasicContentPropertyList): :type correlation_id: binary type (max length 255) (AMQP as shortstr) :param reply_to: address to reply to :type reply_to: binary type (max length 255) (AMQP as shortstr) - :param expiration: message expiration specification + :param expiration: message expiration specification (in milliseconds) :type expiration: binary type (max length 255) (AMQP as shortstr) :param message_id: application message identifier :type message_id: binary type (max length 255) (AMQP as shortstr) @@ -207,6 +207,7 @@ class Exchange(object): :param name: exchange name :param arguments: either a list of (bytes, values) or a dict of (str, value) to pass as an extra argument + :param type: type of the exchange. So far, valid types are 'direct', 'fanout', 'topic' and 'headers' """ __slots__ = ('name', 'type', 'durable', 'auto_delete', 'arguments') @@ -224,6 +225,9 @@ class Exchange(object): self.auto_delete = auto_delete self.arguments = argumentify(arguments) + if self.auto_delete and self.durable: + warnings.warn('What is your purpose in declaring a durable auto-delete exchange?', UserWarning) + assert isinstance(self.name, six.text_type) assert isinstance(self.type, six.binary_type) diff --git a/docs/how-to-guide.rst b/docs/how-to-guide.rst index 951506c2d81d03586f53634db07acfb15c1454c9..48055ba8ccbe276206a2ecaa299c49c671a2b765 100644 --- a/docs/how-to-guide.rst +++ b/docs/how-to-guide.rst @@ -102,3 +102,12 @@ In order to make use of an anonymous queue, you must first :meth:`coolamqp.clust raise ValueError if you try to do that, anyway. Anonymous queues must be auto_delete and exclusive, ValueError will be raised otherwise. + +Who am I talking to? +-------------------- + +To identify the server you're talking to just connect and use :meth:`coolamqp.clustering.Cluster.properties`, +which will return the following class: + +.. autoclass:: coolamqp.objects.ServerProperties + :members: