#!/usr/bin/env python
#Zhangpengfei
import pika
credentials = pika.PlainCredentials('admin','yaochizaocan')
connection = pika.BlockingConnection(pika.ConnectionParameters(
'59.110.123.17',8008,'/',credentials))
channel = connection.channel()
channel.queue_declare(queue='balance')
def callback(ch, method, properties, body):
print(" [x] Received %r" % body)
channel.basic_qos(prefetch_count=1)
channel.basic_consume(callback,
queue='balance',
no_ack=True)
print(' [*] Waiting for messages. To exit press CTRL+C')
channel.start_consuming()