summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Grangaard <Andrew.Grangaard@demandmedia.com>2012-07-30 18:15:30 -0700
committerAndrew Grangaard <Andrew.Grangaard@demandmedia.com>2012-07-30 18:15:30 -0700
commitd34402aaa00ed1d0810204ccd79ef650fd1b6f27 (patch)
tree11cafd17c8e6d1d0f4fc9d502936831d7e371c55
parent25b30c7d855440d5fdfaf4fb114113e43ade5fea (diff)
downloadpy-amqp-d34402aaa00ed1d0810204ccd79ef650fd1b6f27.tar.gz
Sets client's consumer_cancel_notify capability
consumer_cancel_notify needs to be set within the capabilities table within the client-properties, rather than as a top level key. http://www.rabbitmq.com/extensions.html#consumer-cancel-notify | to enable this behaviour, the client must present a capabilities | table in its client-properties in which there is a key | consumer_cancel_notify and a boolean value true. See the capabilities | section for further details on this.
-rw-r--r--amqp/connection.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/amqp/connection.py b/amqp/connection.py
index 90af662..541f566 100644
--- a/amqp/connection.py
+++ b/amqp/connection.py
@@ -748,7 +748,9 @@ class Connection(AbstractChannel):
"""
if self.server_capabilities.get('consumer_cancel_notify'):
- client_properties['consumer_cancel_notify'] = True
+ if 'capabilities' not in client_properties:
+ client_properties['capabilities'] = {}
+ client_properties['capabilities']['consumer_cancel_notify'] = True
args = AMQPWriter()
args.write_table(client_properties)
args.write_shortstr(mechanism)