-
Notifications
You must be signed in to change notification settings - Fork 3.6k
-
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
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.
All reactions
-
#is_open
is relatively new, perhaps you run with an outdated version of the client or these tutorials need a dependency version bump.
Beta Was this translation helpful? Give feedback.