AMQPSSLConnection连接超时

发布于 2025-01-20 09:21:58 字数 804 浏览 6 评论 0原文

当我创建一个新的AMQPSSLConnection对象时,我正在使用Amazon MQ Rabbit的PHP库PHP-AMQPLIB

使用以下

$this->connection = new AMQPSSLConnection(
    $params->get('rabbit_host'),
    $params->get('rabbit_port'),
    $params->get('rabbit_username'),
    $params->get('rabbit_password'),
    $params->get('rabbit_vhost'),
    [
        'verify_peer' => false
    ],
    [
        'heartbeat' => 20,
        'connection_timeout' => 99999,
        'read_write_timeout' => 99999,
        'channel_rpc_timeout' => 99999
    ]
); 

内容:

[phpamqplib \ extception \ amqptimeOutException]在0.33318181881904602 sec之后均超时,请访问该连接。数据

在脚本运行60秒后。我尝试了各种心跳和超时设置的值,但是没有一个使脚本运行

编辑 - 此问题是由我将超时值传递到$ channel-> wait()引起的。一旦我增加了第三个参数值(超时),则解决了问题

I am using the PHP library php-amqplib with Amazon MQ Rabbit

When I create a new AMQPSSLConnection object with like the following:

$this->connection = new AMQPSSLConnection(
    $params->get('rabbit_host'),
    $params->get('rabbit_port'),
    $params->get('rabbit_username'),
    $params->get('rabbit_password'),
    $params->get('rabbit_vhost'),
    [
        'verify_peer' => false
    ],
    [
        'heartbeat' => 20,
        'connection_timeout' => 99999,
        'read_write_timeout' => 99999,
        'channel_rpc_timeout' => 99999
    ]
); 

I get the error:

[PhpAmqpLib\Exception\AMQPTimeoutException] The connection timed out after 0.33181881904602 sec while awaiting incoming data

after 60 seconds of the script running. I've tried various values for heartbeat and timeout settings but none keep the script running

Edit - This issue was caused by me passing in a timeout value to $channel->wait(). Once I increased the 3rd parameter value (timeout), the issue was resolved

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

若沐 2025-01-27 09:21:58

这个问题是由于我向 $channel->wait() 传递了一个超时值引起的。一旦我增加了第三个参数值(超时),问题就解决了

This issue was caused by me passing in a timeout value to $channel->wait(). Once I increased the 3rd parameter value (timeout), the issue was resolved

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文