我正在尝试通过python连接RabbitMQ,但是每次都会收到AMQPConnectionError

时间:2020-01-25 10:06:37

标签: python rabbitmq

import pika

credentials = pika.PlainCredentials(username='guest', password='guest')
connection = 'amqp://10.0.4.143'
connection = pika.BlockingConnection(
    pika.ConnectionParameters(host='10.0.5.183'))
channel = connection.channel()

channel.queue_declare(queue='hello')

channel.basic_publish(exchange='', routing_key='hello.', body='Hello World!')
print(" [x] Sent 'Hello World!'")
connection.close()

我得到的错误是提高自我。_reap_last_connection_workflow_error(error) pika.exceptions.AMQPConnectionError

0 个答案:

没有答案