php - 节点使用 VIP 的 php-amqplib heatbeat 问题
问题描述
当rabbitmq服务器节点使用VIP并漂移时,客户端进程将保持并且没有心跳:
while (count($this->channel->callbacks)) {
$this->channel->wait();
}
当 VIP 漂移时,客户端会打开AbstractConnection::wait_channel()
:
list($frame_type, $frame_channel, $payload) = $this->wait_frame($_timeout);
因为$_timeout default set 0
解决方案
该过程在 StreamIO.php select() 上进行:
$result = stream_select($read, $write, $except, $sec, $usec);
我们可以通过定义环境变量来避免它
define('AMQP_WITHOUT_SIGNALS', true);
推荐阅读
- ruby - 试图了解这些 if else 语句如何正确关闭
- windows - 当任务计划程序完成“带有返回码......”时如何设置电子邮件通知
- python - C# 中的 3D Perlin Noise Normalize 函数
- python - 默认使用 Python 3.x 时使用 Python 2.7 的 Webbot
- sql - 从表中捕获值并在 SQL 函数中声明为局部变量
- terraform - Terraform 动态生成属性(不是块)
- bouncycastle - 在 .net5 中使用证书
- scala - Spark : 我如何找到一起乘坐超过 3 个航班的乘客
- python - Pytest 捕获某个测试的标准输出
- discord - 我如何使用 Discord 机器人踢人?