Php-amqplib: Error: The connection timed out after 3 sec while awaiting incoming data

Created on 3 Jan 2019  路  6Comments  路  Source: php-amqplib/php-amqplib

Hello, i am facing this issue:

PHP Fatal error:  Uncaught exception 'PhpAmqpLib\Exception\AMQPTimeoutException' with message 'The connection timed out after 3 sec while awaiting incoming data' in /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php:132
Stack trace:
#0 /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php(148): PhpAmqpLib\Wire\AMQPReader->wait()
#1 /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php(106): PhpAmqpLib\Wire\AMQPReader->rawread(7)
#2 /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(522): PhpAmqpLib\Wire\AMQPReader->read(7)
#3 /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Connection/AbstractConnection.php(570): PhpAmqpLib\Connection\AbstractConnection->wait_frame(3)
#4 /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Channel/AbstractChannel.php(225): PhpAmqpLib\Connection\AbstractConnection->wait_ch in /var/www/personal/xxxxxx/vendor/php-amqplib/php-amqplib/PhpAmqpLib/Wire/AMQPReader.php on line 132

Does anyone know how to fix it?

Thanks!

Most helpful comment

same happens to me.
I declared a queue from rabbitmq admin web interface 'my_queue', then I created a consumer with this code:

$callback = function ($msg) {
  echo ' [x] Received ', $msg->body, "\n";
};

$channel->basic_consume('my_queue', '', false, true, false, false, $callback);

while (count($channel->callbacks)) {
    $channel->wait();
}

I started the consumer but this error appeared.

The connection timed out after 3 sec while awaiting incoming data

The issue was in the port where the client listening to, it was set to "15672" while it should be "5672".
Port 15672 for rabbitmq web interface.
Port 5672 for rabbitmq client.

All 6 comments

Does your queue have any data? Can you share code to reproduce this?

Same issue after upgrading from PHP 7.2 to 7.3

It would really, really help to provide more information, like code, steps to reproduce, messages from your AMQP broker's logs. Anything other than "me too".

same happens to me.
I declared a queue from rabbitmq admin web interface 'my_queue', then I created a consumer with this code:

$callback = function ($msg) {
  echo ' [x] Received ', $msg->body, "\n";
};

$channel->basic_consume('my_queue', '', false, true, false, false, $callback);

while (count($channel->callbacks)) {
    $channel->wait();
}

I started the consumer but this error appeared.

The connection timed out after 3 sec while awaiting incoming data

The issue was in the port where the client listening to, it was set to "15672" while it should be "5672".
Port 15672 for rabbitmq web interface.
Port 5672 for rabbitmq client.

Fixed by #642, closing.

same happens to me.
I declared a queue from rabbitmq admin web interface 'my_queue', then I created a consumer with this code:

$callback = function ($msg) {
  echo ' [x] Received ', $msg->body, "\n";
};

$channel->basic_consume('my_queue', '', false, true, false, false, $callback);

while (count($channel->callbacks)) {
    $channel->wait();
}

I started the consumer but this error appeared.

The connection timed out after 3 sec while awaiting incoming data

The issue was in the port where the client listening to, it was set to "15672" while it should be "5672".
Port 15672 for rabbitmq web interface.
Port 5672 for rabbitmq client.

Thank you.. It works fine.. when I change port to rabbitmq client as 5672..

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ltanme picture ltanme  路  8Comments

speller picture speller  路  5Comments

kozlice picture kozlice  路  4Comments

d3xt3r01 picture d3xt3r01  路  8Comments

helloEson picture helloEson  路  3Comments