Registry /
messaging / videlalvaro-php-amqplib
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AMQPStreamConnection
✓ use PhpAmqpLib\Connection\AMQPStreamConnection;
Connect to RabbitMQ and publish a message to a queue.
use PhpAmqpLib\Connection\AMQPStreamConnection;
use PhpAmqpLib\Message\AMQPMessage;
$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest');
$channel = $connection->channel();
$channel->queue_declare('hello', false, false, false, false);
$msg = new AMQPMessage('Hello World!');
$channel->basic_publish($msg, '', 'hello');
$channel->close();
$connection->close();
Audit
Dependencies
No dependency data recorded yet.