UnrealEngine
V2EX  ›  PHP

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

  •  
  •   UnrealEngine · Dec 28, 2023 · 2597 views
    This topic created in 1061 days ago, the information mentioned may be changed or developed.

    日志:

    2023-12-28 17:02:07 2023-12-28 13:02:07.875320+00:00 [info] <0.8575.0> accepting AMQP connection <0.8575.0> (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] <0.8575.0> connection <0.8575.0> (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] <0.8575.0> closing AMQP connection <0.8575.0> (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 安装成功也能成功进入管理页面

    4 replies  •  2023-12-30 18:34:13 +08:00
    UnrealEngine
    UnrealEngine
    OP
    Dec 28, 2023
    1
    UnrealEngine
    UnrealEngine
    OP
    Dec 28, 2023
    2
    connect()直接返回了 null ,用 try catch 试过也不抛出异常
    ainon
    ainon
    Dec 29, 2023
    3
    看看 php 侧可有问题
    UnrealEngine
    UnrealEngine
    OP
    Dec 30, 2023
    4
    @ainon #3 扩展都安装好了的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2576 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:50 · PVG 19:50 · LAX 03:50 · JFK 06:50
    ♥ Do have faith in what you're doing.