关于openstack中队列池容量限制报错的解决

在server.log中报出以下错误: python











显示为队列池容量问题,致使链接失败。 server

利用命令rabbitmqctl list_queues 查看队列信息,发现q_plugin队列中有150000条信息,别的队列都是空的,显然出问题了,应该是消息只进不出,缘由在于消息队列堵塞,到底什么缘由致使堵塞,不明确。 rabbitmq

解决办法:写一个python脚本,把q_plugin队列中的全部消息取出,清空。 队列

脚本代码: 消息队列



   import pika
   connection=pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
   channel=connection.channel()
   channel.queue_declare(queue='q-plugin')
   def callback(ch,method,properties,body):
           print "Received %r" % (body,)
   channel.basic_consume(callback,queue='q-plugin',no_ack=True)
   channel.start_consuming() it

说明:须要安装pika包
io

相关文章
相关标签/搜索