AMQPSSLConnection connection timeout

1k views Asked by At

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

1

There are 1 answers

0
Ste On

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