'AMQPSSLConnection connection timeout

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



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ste