RabbitMq 连接失败,查看 mq 日志显示连接成功但是又立马关闭了

查看 66|回复 2
作者:UnrealEngine   
日志:
2023-12-28 17:02:07 2023-12-28 13:02:07.875320+00:00 [info]  accepting AMQP connection  (172.26.0.8:45438 -> 172.26.0.2:5672)
2023-12-28 17:02:07 2023-12-28 13:02:07.877505+00:00 [info]  connection  (172.26.0.8:45438 -> 172.26.0.2:5672): user 'guest' authenticated and granted access to vhost '/'
2023-12-28 17:02:07 2023-12-28 13:02:07.877753+00:00 [info]  closing AMQP connection  (172.26.0.8:45438 -> 172.26.0.2:5672, vhost: '/', user: 'guest')
代码:
//创建连接
$this->connection = new \AMQPConnection($this->config);
if (!$this->connection->connect()) {
throw new \Exception('RabbitMQ 创建连接失败');
}
config:
array(
'host' => rabbitmq
'port' => 5672
'login' => guest
'password' => guest
'vhost' => ''
);
rabbitmq 安装成功也能成功进入管理页面

2023-12-28, rabbitmq

UnrealEngine
OP
  


UnrealEngine
OP
  
connect()直接返回了 null ,用 try catch 试过也不抛出异常
您需要登录后才可以回帖 登录 | 立即注册

返回顶部