From cba5a2b2393a43d7891857410838bd7d58c96c35 Mon Sep 17 00:00:00 2001 From: User Date: Mon, 16 Dec 2019 23:33:51 +0300 Subject: [PATCH] Update get_messages func to support rabbitmq management 3.8 --- pyrabbit/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyrabbit/api.py b/pyrabbit/api.py index 2e2b487..b1d5491 100644 --- a/pyrabbit/api.py +++ b/pyrabbit/api.py @@ -628,9 +628,11 @@ def get_messages(self, vhost, qname, count=1, :returns: list of dicts. messages[msg-index]['payload'] will contain the message body. """ - + ackmode = 'ack_requeue_false' + if requeue: + ackmode = 'ack_requeue_true' vhost = quote(vhost, '') - base_body = {'count': count, 'requeue': requeue, 'encoding': encoding} + base_body = {'count': count, 'ackmode': ackmode, 'encoding': encoding} if truncate: base_body['truncate'] = truncate body = json.dumps(base_body)