我正在对使用 CodeIgniter 开发的消息队列解决方案进行原型设计。该代码托管在 GoDaddy 基本共享托管计划上,并连接到 CloudAMQP 上的 RabbitMQ 试用实例。我使用videlalvaro/php-amqplib 库。
该解决方案运行了几天,昨天我开始收到连接被拒绝错误。代码没有更改,实际上在我的本地机器上运行的相同代码可以正常工作并连接到 CloudAMQP。
这让我相信问题可能出在 GoDaddy 托管上。花了大约 48 小时试图解决这个问题,我的项目现在停滞不前。
有没有人有任何想法?我现在唯一的选择是转移到不同的托管服务并尝试,但这是重要的一步,我想确保我不会错过一些小东西。
下面代码的相关部分:
$url = parse_url("amqp://yyyyyyyy:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@moose.rmq.cloudamqp.com/yyyyyyyy");
//Masking the user name and password for here
$conn = new AMQPStreamConnection(
$url['host'], //host - CloudAMQP_URL
5672, //port - port number of the service, 5672 is the default
$url['user'], //user - username to connect to server
$url['pass'], //password - password to connect to the server
substr($url['path'], 1) //vhost
);