赞
踩
文章来源:http://blog.csdn.net/qq_26656329/article/details/78832107
import pika
credentials = pika.PlainCredentials(username='mq', password='654321')
connection = pika.BlockingConnection(
pika.ConnectionParameters(
host='localhost', port=5672, virtual_host='/',
credentials=credentials
)
)
channel = connection.channel()
channel.exchange_declare(
exchange='test',
exchange_type='topic',
durable=True,
)
channel.queue_declare(queue='test', durable=True)
channel.queue_bind(exchange='test', queue='test', routing_key='t')
for i in range(0, 1000000):
channel.basic_publish(
routing_key='t&#
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。