Download the PHP package wuwx/laravel-plus-amqp without Composer
On this page you can find all versions of the php package wuwx/laravel-plus-amqp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-plus-amqp
laravel-plus-amqp
Laravel AMQP 扩展,基于 PHP ext-amqp 提供连接、交换机、队列的简单管理与发布/消费封装。
特性
- 通过配置统一管理 AMQP 连接、交换机与队列
- 首次使用时自动声明 exchange/queue,并完成 bindings
- 支持 Facade 与容器单例两种使用方式
环境要求
- PHP 扩展:
ext-amqp(composer.json中为 suggest) - Laravel 版本:
illuminate/support~5.1 或 ^6 ~ ^12
安装
服务提供者
Laravel 5.5+ 会自动发现服务提供者:
Wuwx\LaravelPlusAmqp\LaravelPlusAmqpServiceProvider
Laravel 5.4 及以下版本需手动注册:
发布配置
发布后配置文件位于:config/amqp.php。
快速上手
- 安装扩展并确保
ext-amqp可用 - 发布配置并设置连接信息
- 使用 Facade 发布/消费消息
示例环境变量
配置说明
默认配置来自 config/amqp.php:
connections数组会作为AMQPConnection的参数传入。exchanges首次调用时会自动声明(declareExchange)。queues首次调用时会自动声明并执行bindings(bind)。bindings结构为[exchange, routing_key],等价于$queue->bind($exchange, $routingKey)。
使用方式
包内通过容器单例 amqp 提供管理器,也提供 Facade:Wuwx\LaravelPlusAmqp\AmqpFacade。
发布消息
消费消息
publish与consume的参数会直接透传给AMQPExchange::publish与AMQPQueue::consume, 具体参数请参考ext-amqp文档。
使用指定连接/交换机/队列
项目结构
开发与测试
All versions of laravel-plus-amqp with dependencies
PHP Build Version
Package Version
Requires
illuminate/support Version
^5.6|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
The package wuwx/laravel-plus-amqp contains the following files
Loading the files please wait ...