Skip to content
Permalink
master
Switch branches/tags
Go to file
@jasonmarquette
Latest commit e1322a0 Jan 3, 2019 History
Adding close tag.
4 contributors

Users who have contributed to this file

@videlalvaro @majek @jeffreydwalter @jasonmarquette
<?php
require_once __DIR__ . '/vendor/autoload.php';
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');
echo " [x] Sent 'Hello World!'\n";
$channel->close();
$connection->close();
?>