'Sends the AMQP 0-9-1 command Basic.Consume to the broker and binds messages
for the consumer_tag to the consumer callback. If you do not pass in
a consumer_tag, one will be automatically generated for you. Returns
the consumer tag.
For more information on basic_consume, see:
Tutorial 2 at http://www.rabbitmq.com/getstarted.html
http://www.rabbitmq.com/confirms.html
http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume
:param callable consumer_callback: The function to call when consuming
with the signature consumer_callback(channel, method, properties,
body), where
channel: pika.Channel
method: pika.spec.Basic.Deliver
properties: pika.spec.BasicProperties
body: str, unicode, or bytes (python 3.x)
:param queue: The queue to consume from
:type queue: str or unicode
:param bool no_ack: if set to True, automatic acknowledgement mode will be used
(see http://www.rabbitmq.com/confirms.html)
:param bool exclusive: Don\'t allow other consumers on the queue
:param consumer_tag: Specify your own consumer tag
:type consumer_tag: str or unicode
:param dict arguments: Custom key/value pair arguments for the consumer
:rtype: str'

def basic_consume(self, consumer_callback, queue='', no_ack=False, exclusive=False, consumer_tag=None, arguments=None):

    self._validate_channel_and_callback(consumer_callback)
    if (not consumer_tag):
        consumer_tag = self._generate_consumer_tag()
    if ((consumer_tag in self._consumers) or (consumer_tag in self._cancelled)):
        raise exceptions.DuplicateConsumerTag(consumer_tag)
    if no_ack:
        self._consumers_with_noack.add(consumer_tag)
    self._consumers[consumer_tag] = consumer_callback
    self._rpc(spec.Basic.Consume(queue=queue, consumer_tag=consumer_tag, no_ack=no_ack, exclusive=exclusive, arguments=(arguments or dict())), self._on_eventok, [(spec.Basic.ConsumeOk, {'consumer_tag': consumer_tag})])
    return consumer_tag
