简体   繁体   中英

Can't connect to RabbitMQ via docker container

I can't connect to RabbitMQ via docker file.

After using docker run I'm getting

pika.exceptions.AMQPConnectionError

That's line 14 and 15

connection = pika.BlockingConnection(pika.ConnectionParameters(host=cfg.RABBIT_HOST))
channel = connection.channel()

and config file

RABBIT_HOST= 'localhost'
QUEUE_TOPIC = 'topic_name'

connecting to localhost:15672 works and it's showing me rabbitmq login window, but still doesn't work with python connection

Ok, that was my fault. Adding the credentials fixed the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM