grigorieff/yii2-amqp
Composer 安装命令:
composer require grigorieff/yii2-amqp
包简介
Yii2 component for AMQP
关键字:
README 文档
README
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist grigorieff/yii2-amqp "*"
or add
"grigorieff/yii2-amqp": "*"
to the require section of your composer.json.
Configuration
Add to your app config:
'components' => [ ......... 'amqp' => [ 'class' => grigorieff\amqp\Amqp, 'host' => 'localhost', 'port' => '5672', 'user' => 'guest', 'password' => 'guest' ], ......... ];
Usage
// get AMQP component $amqp = Yii::$app->amqp; // declare exchange $amqp->exchangeDeclare('myExchange','fanout'); // declare queue $amqp->queueDeclare('myQueue'); // binding queue $amqp->bindQueueExchange('myQueue','myExchange'); // basic publish message $amqp->basicPublish($message, $exchange, $routingKey); ......
License
MIT
Requirements
This Yii2 component require PhpAmqpLib
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-09