bkjones/pyrabbit

get_messages now requires 'ackmode' on request

henryclon opened this issue · 1 comments

get_messages shows an error when trying it with the latest rabbitMQ, missing key 'ackmode'
When using the web browser GUI, there is a field called "Ack mode" for getting messages from a queue, upon further inspection these are the values:

<select name="ackmode">
                <option value="ack_requeue_true" selected="">Nack message requeue true</option>
                <option value="ack_requeue_false">Automatic ack</option>
                <option value="reject_requeue_true">Reject requeue true</option>
                <option value="reject_requeue_false">Reject requeue false</option>
</select>

I added it to my local pyrabbit package and it works :)

def get_messages(self, vhost, qname, count=1,
                     requeue=False, truncate=None, encoding='auto', ackmode='ack_requeue_false'):
...
base_body = {'count': count, 'requeue': requeue, 'encoding': encoding, 'ackmode': ackmode}

This issue is already solved on a pull request