我使用amqp客户端连接ActiveMQ代理。
import amqp
USER =“来宾”密码=“客人”HOST =‘localhost’PORT =‘5672’
host = HOST +“:”+ PORT
conn = amqp.connection.Connection(host = host,…
看起来连接参数默认为正确的设置。
试试吧
import amqp USER = "guest" PASSWORD = "guest" HOST = '/' PORT = '5672' host = HOST + ":" + PORT conn = amqp.connection.Connection() conn.connect() print(conn.is_closing)
如果你看一下Connection()的实现
def __init__(self, host='localhost:5672', userid='guest', password='guest', login_method=None, login_response=None,
...
所以它默认为正确的东西,并使用兔子mq本地运行。
希望这可以帮助!