andrewmy / rabbitmq-management-api
针对RabbitMQ管理HTTP API的对象封装;richardfullmer的PHP 8分支
2.1.2
2022-02-10 16:27 UTC
Requires
- php: ^7.1|^8.0
- php-http/client-common: ^2.2.1
- php-http/client-implementation: ^1.0
- php-http/discovery: ^1.0
- php-http/httplug: ^2.0
- php-http/message-factory: ^1.0
- psr/http-message: ^1.0
This package is auto-updated.
Last update: 2024-09-17 15:17:20 UTC
README
PHP 7.1+中RabbitMQ管理HTTP API的简单对象封装
使用PHP-HTTP进行请求。
richardfullmer/rabbitmq-management-api的PHP 8兼容分支。
安装
通过composer安装
$ composer require andrewmy/rabbitmq-management-api
此外,您需要一个httplug兼容客户端。
例如,使用Guzzle 7适配器
$ composer require php-http/guzzle7-adapter
基本用法
<?php use RabbitMq\ManagementApi\Client; require_once __DIR__ . '/../vendor/autoload.php'; $client = new Client(); $queue = $client->queues()->get('/', 'sample-messages-queue'); $response = $client->exchanges()->publish('/', 'sample-messages', array( 'properties' => array(), 'routing_key' => '', 'payload' => 'This is a test', 'payload_encoding' => 'string' )); if ($response['routed']) { print 'Message delivered'; }
许可证
php-rabbitmq-management-api遵循MIT许可证 - 详细信息请参阅LICENSE文件
鸣谢
Rabbit的卓越消息队列