定制 farshidrezaei/larabbitmq 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

farshidrezaei/larabbitmq

Composer 安装命令:

composer require farshidrezaei/larabbitmq

包简介

Laravel RabbitMq integration.

README 文档

README

Installation

composer

composer require farshidrezaei/larabbitmq

Larabbitmq environment

Set bellow config to .env file with your installed rabbitmq credential

LARABBITMQ_RABBIT_HOST=
LARABBITMQ_RABBIT_PORT=
LARABBITMQ_RABBIT_USERNAME=
LARABBITMQ_RABBIT_PASSWORD=

Config

Call bellow command to publish config file:

php artisan vendor:publish --provider="FarshidRezaei\Larabbitmq\Providers\LarabbitmqServiceProvider" --tag="config"

Usage:

publish:

You can use Larabbitmq Facade easily to publish messages on specified queue.

use FarshidRezaei\Larabbitmq\Facades\Larabbitmq;

Larabbitmq::publish( 'default_queue','default_exchange','simple_text_message' );

consume:

For consuming a queue you should create consume handler class and specified it for a queue in config/larabbitmq.php .

call bellow command to create new consume handler class:

php artisan larabbitmq:make-consume-handler ExampleConsumeHandler

Then ExampleConsumeHandler.php class will create in app/LarabbitmqConsumeHandlers. you must add this to config/larabbitmq.php like this:

// config/larabbitmq.php
  
  // ...
  
  'consume-handlers' => [
    'default_queue'=>App\LarabbitmqConsumeHandlers\ExampleConsumeHandler::class
  ]
    
  // ...

Now you can call bellow command to consume specifed queue:

php artisan larabbitmq:consume --queue=default_queue

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 22
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固