diff --git a/oslo/messaging/_drivers/amqpdriver.py b/oslo/messaging/_drivers/amqpdriver.py index 158248883..1b1cac494 100644 --- a/oslo/messaging/_drivers/amqpdriver.py +++ b/oslo/messaging/_drivers/amqpdriver.py @@ -90,9 +90,7 @@ class AMQPListener(base.Listener): def poll(self): while True: if self.incoming: - message = self.incoming.pop(0) - message.acknowledge() - return message + return self.incoming.pop(0) self.conn.consume(limit=1) diff --git a/oslo/messaging/notify/dispatcher.py b/oslo/messaging/notify/dispatcher.py index a79cc29e8..1bcf84c93 100644 --- a/oslo/messaging/notify/dispatcher.py +++ b/oslo/messaging/notify/dispatcher.py @@ -60,6 +60,7 @@ class NotificationDispatcher(object): @contextlib.contextmanager def __call__(self, incoming): yield lambda: self._dispatch_and_handle_error(incoming) + incoming.acknowledge() def _dispatch_and_handle_error(self, incoming): """Dispatch a notification message to the appropriate endpoint method. diff --git a/oslo/messaging/rpc/dispatcher.py b/oslo/messaging/rpc/dispatcher.py index ecb1e8795..b9d114f87 100644 --- a/oslo/messaging/rpc/dispatcher.py +++ b/oslo/messaging/rpc/dispatcher.py @@ -124,6 +124,7 @@ class RPCDispatcher(object): @contextlib.contextmanager def __call__(self, incoming): + incoming.acknowledge() yield lambda: self._dispatch_and_reply(incoming) def _dispatch_and_reply(self, incoming):