I'm using the RabbitMQ Library videlalvaro/php-amqplib inside a Laravel 4.2 application and I've started getting the following error:
fwrite(): send of 12 bytes failed with errno=104 Connection reset by peer"
Can anyone suggest anything that might be causing this?
"Connection reset by peer" is the TCP/IP equivalent of slamming the phone back on the hook. It's more polite than merely not replying, leaving one hanging. But it's not the FIN-ACK expected of the truly polite TCP/IP converseur. (From other SO answer)
So you can't do anything about it, it is the issue of the server.
But you could use try .. catch
block to handle that exception:
try {
$msg = new AMQPMessage('Hello World!');
$channel->basic_publish($msg, '', 'hello');
} catch (Exception $e) {
// handle exception
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With