Replies: 1 comment 1 reply
-
Accodring to this tutorial: https://github.com/rabbitmq/rabbitmq-tutorials/blob/main/php/receive.php What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Code:
$connection = new PhpAmqpLib\Connection\AMQPSSLConnection( $host, $port, $user, $password, $vhost = '/', $ssl_opts); $channel = $connection->channel(); $channel->queue_declare('reply-queue', false, true, false, false); echo " [*] Waiting for messages..."; $callback = function ($reply_msg) { echo ' [x] Received ', $reply_msg->body, "\n"; }; $channel->basic_consume('reply-queue', '', false, true, false, false, $callback); while ($channel->is_open()) { $channel->wait(); } $channel->close(); $connection->close();
Error:
Fatal error: Uncaught Error: Call to undefined method PhpAmqpLib\Channel\AMQPChannel::is_open()
Beta Was this translation helpful? Give feedback.
All reactions