laborer-by/laravel-rabbitmq
Composer 安装命令:
composer require laborer-by/laravel-rabbitmq
包简介
RabbitMQ driver for Laravel.
关键字:
README 文档
README
RabbitMQ driver for Laravel.
Installation
(1) Install this package via composer using:
composer require laborer-by/laravel-rabbitmq
(2) Add these properties to .env with proper values:
;RABBITMQ dev
RABBITMQ_HOST=127.0.0.1
RABBITMQ_PORT=5672
RABBITMQ_USER=guest
RABBITMQ_PASSWORD=guest
RABBITMQ_VHOST=oc
(3) Create a table:
CREATE TABLE `tmp_rabbitmq_msg` ( `msg_id` char(20) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '消息的唯一id', `routing_key` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT 'routing_key 消息的路由键', `source` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '消息的来源', `msg_data` mediumtext COLLATE utf8_unicode_ci NOT NULL COMMENT '消息的主体数据', `extra_data` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '额外的数据', `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', UNIQUE KEY `index_msg_id` (`msg_id`) USING BTREE, KEY `index_routing_key` (`routing_key`) USING BTREE, KEY `index_created_at` (`created_at`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='rabbitmq消息表';
Config
Register LaravelRabbitMQServiceProvider via config/app.php:
'providers' => [
// others ...
Laborer\LaravelRabbitMQ\LaravelRabbitMQServiceProvider::class,
],
To publish the config file, run the following:
php artisan vendor:publish --provider="Laborer\LaravelRabbitMQ\LaravelRabbitMQServiceProvider"
Changelog
You will find a complete changelog history within the CHANGELOG file.
Testing
Run tests with PHPUnit:
vendor/bin/phpunit
OR
composer test
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-03-03