# !/usr/bin/env python
import pika
credentials = pika.PlainCredentials('admin','yaochizaocan')
connection = pika.BlockingConnection(pika.ConnectionParameters(
'59.110.123.17',8008,'/',credentials))
channel = connection.channel()

# 声明queue
channel.queue_declare(queue='balance')

# n RabbitMQ a message can never be sent directly to the queue, it always needs to go through an exchange.
cnt = 4000000
while (cnt !=0):

channel.basic_publish(exchange='',
routing_key='balance',
body='H')
cnt -=1
print(4000000-cnt," [x] 1")
connection.close()
posted on 2018-04-24 16:14  DisCover_ry  阅读(318)  评论(0编辑  收藏  举报