chella / amqp

v0.0.1 2021-10-20 13:57 UTC

This package is auto-updated.

Last update: 2024-09-06 19:02:59 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

设置

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');

编码愉快