diff --git a/pyinfra/queue/queue_manager.py b/pyinfra/queue/queue_manager.py index 4cd4a05..9e945d5 100644 --- a/pyinfra/queue/queue_manager.py +++ b/pyinfra/queue/queue_manager.py @@ -75,11 +75,11 @@ class QueueManager(object): unpacked_message_body = json.loads(body) callback_result = process_message_callback(unpacked_message_body) + self._channel.basic_ack(frame.delivery_tag) + self.logger.info("Processed message, publishing result to result-queue") self._channel.basic_publish("", self._output_queue, json.dumps(callback_result).encode()) - - self._channel.basic_ack(frame.delivery_tag) except Exception as ex: n_attempts = _get_n_previous_attempts(properties) + 1 self.logger.warning(f"Failed to process message, {n_attempts} attempts, error: {str(ex)}")