RabbitMQ 和不稳定的连接

发布于 2025-01-04 15:02:50 字数 144 浏览 4 评论 0原文

我将 RabbitMQ 与 PHP 结合使用(通过 php-amqplib)。但是我的消费者运行的服务器的连接确实不稳定。因此,每 15-30 分钟消费者就会失去与远程rabbitmq服务器的连接,但 php 守护进程仍在运行。在这种情况下有什么解决方案可以处理有损连接吗?

I'm using RabbitMQ with PHP (via php-amqplib). But server, where my consumer is running, has really unstable connection. So, each 15-30 minutes consumer losts connection to the remote rabbitmq server, but php daemon still running. Is there any solution to handle lossy connections in this case?

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

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

发布评论

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

评论(1

无风消散 2025-01-11 15:02:50

您应该使用心跳进行连接,但如果此后问题仍然存在,您最好记录连接错误,以便验证连接的情况。

You should use heartbeats for the connection but if the problem continues after that you'd better log the connection errors in order to verify what's going on with the connectivity.

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