Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fatal error: Uncaught PhpAmqpLib\Exception\AMQPConnectionClosedException: Broken pipe or closed connection #322

Funny-dot started this conversation in General
Discussion options

why?
my service is localhost;
image

my codes:

use PhpAmqpLib\Message\AMQPMessage;
include_once './vendor/autoload.php';
//创建连接和channel
$connection = new AMQPStreamConnection('127.0.0.1', 5672, 'admin', 'admin','/',false,
 'PLAIN','','en_US',3,3,null,true,15,3);
$channel = $connection->channel();
$channel->queue_declare('hello', false, false, false, false);
$msg = new AMQPMessage('Hello World!');
$channel->basic_publish($msg, '', 'hello');
echo " [x] Sent 'Hello World!'\n";
$channel->close();
$connection->close();```
You must be logged in to vote

Replies: 1 comment

Comment options

RabbitMQ logs all connection lifecycle events as well as various exceptions. Start with inspecting the logs.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #321 on June 15, 2022 08:22.

AltStyle によって変換されたページ (->オリジナル) /