Skip to content

Commit

Permalink
Adds multiple kwarg to Qpid Channel.basic_ack (#700)
Browse files Browse the repository at this point in the history
Celery 4.0.2 passes the `multiple` keyword argument to `basic_ack`.
This did not used to occur with 3.1.20- so this change is only being
merged into the 4.0 branch. The desired functionality of this param is
documented here [0], but the Qpid transport uses UUIDs as the
delivery_tags so we don't have a record of the sequential messages
required to implement this. We use UUIDs as the deliver_tag to avoid
Issue #563.

With the functionality for the `multiple` parameter not implemented, an
AssertionError is raised if Celery attempts to meaningfully use the
`multiple` parameter with the Qpid transport. A developer or user who
encounters this AssertionError should file a bug with Kombu.

[0] http://amqp.readthedocs.io/en/latest/reference/amqp.connection.html#amqp.connection.Connection.Channel.basic_ack

closes #699
  • Loading branch information
bmbouter committed Feb 26, 2017
1 parent 4a690ce commit 806a31f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kombu/transport/qpid.py
Expand Up @@ -850,7 +850,7 @@ def basic_get(self, queue, no_ack=False, **kwargs):
except Empty:
pass

def basic_ack(self, delivery_tag):
def basic_ack(self, delivery_tag, multiple=False):
"""Acknowledge a message by delivery_tag.
Acknowledges a message referenced by delivery_tag. Messages can
Expand All @@ -864,8 +864,12 @@ def basic_ack(self, delivery_tag):
:param delivery_tag: The delivery tag associated with the message
to be acknowledged.
:type delivery_tag: uuid.UUID
:param multiple: not implemented. If set to True an AssertionError
is raised.
:type multiple: bool
"""
assert multiple is False
self.qos.ack(delivery_tag)

def basic_reject(self, delivery_tag, requeue=False):
Expand Down

0 comments on commit 806a31f

Please sign in to comment.