Invoked by pika when a message is delivered from RabbitMQ. The
    channel is passed for your convenience. The basic_deliver object that
    is passed in carries the exchange, routing key, delivery tag and
    a redelivered flag for the message. The properties passed in is an
    instance of BasicProperties with the message properties and the body
    is the message that was sent.

    :param pika.channel.Channel channel: The channel object
    :param pika.Spec.Basic.Deliver method: The Deliver method
    :param pika.Spec.BasicProperties properties: The client properties
    :param str|unicode body: The message body

def _on_message(channel, method, header, body):
    """
    Invoked by pika when a message is delivered from RabbitMQ. The
    channel is passed for your convenience. The basic_deliver object that
    is passed in carries the exchange, routing key, delivery tag and
    a redelivered flag for the message. The properties passed in is an
    instance of BasicProperties with the message properties and the body
    is the message that was sent.

    :param pika.channel.Channel channel: The channel object
    :param pika.Spec.Basic.Deliver method: The Deliver method
    :param pika.Spec.BasicProperties properties: The client properties
    :param str|unicode body: The message body
    """
    print "Message:"
    print "\t%r" % method
    print "\t%r" % header
    print "\t%r" % body

    # Acknowledge message receipt
    channel.basic_ack(method.delivery_tag)

    # when ready, stop consuming
    channel.stop_consuming()