chella / amqp
库
v0.0.1
2021-10-20 13:57 UTC
Requires
- php-amqplib/php-amqplib: ^3.0
README
设置
Composer
composer require chella/amqp
编写服务
包含自动加载
require_once "./vendor/autoload.php";
导入服务
use chella\amqp\App;
创建实例
1st arg is hostname
2nd arg is username
3rd arg is password
4th arg is port
5th arg is vhost
$context = App::context('localhost', 'guest', 'guest', 5672, '/');
发布消息
1st arg is message
2nd arg is exchange
3rd arg is routing_key
$context->publish('hello world', 'test', 'test_routing');
编码愉快