<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def consume(self, queue_name, no_ack, prefetch_count):
 """Consume messages from RabbitMQ, changing the state, QoS and issuing the RPC to RabbitMQ to start delivering messages. :param str queue_name: The name of the queue to consume from :param False no_ack: Enable no-ack mode :param int prefetch_count: The number of messages to prefetch """

        if self.state == self.STATE_ACTIVE:
            self.logger.debug('%s already consuming', self.name)
            return
        self.set_state(self.STATE_ACTIVE)
        self.channel.basic_qos(self.on_qos_set, 0, prefetch_count, False)
        self.channel.basic_consume(
            consumer_callback=self.on_delivery, queue=queue_name,
            no_ack=no_ack, consumer_tag=self.consumer_tag)