定制 6phere/horizon-wildcard-consumer 二次开发

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

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

6phere/horizon-wildcard-consumer

最新稳定版本:v1.0.0

Composer 安装命令:

composer require 6phere/horizon-wildcard-consumer

包简介

Extended Laravel Horizon providing listening dynamically added queues matched by wildcard.

README 文档

README

This package allows you to listen queues added dynamically by having wildcard * in queue names in Horizon config file.

Installation

You can install the package via composer using the following command:

composer require 6phere/horizon-wildcard-consumer

Usage

This package provides single command to consume dynamically added queues:

php artisan horizon:wildcard-consume

Before running this command make sure you added wildcards to your supervisor in Horizon config file. This command works just like standard php artisan horizon command if you don't have any wildcards in config.

Example horizon config

config/horizon.php environments section (please notice * in queue names):

connection can be set to rabbitmq

'environments' => [
    'production' => [
        'supervisor-1' => [
            'connection' => 'redis',
            'queue' => ['default', 'user_*_notes', '*-bills'],
            'balance' => 'auto',
            'processes' => 10,
            'tries' => 3,
        ],
        'supervisor-2' => [
            'connection' => 'redis',
            'queue' => ['agent_*_calls', 'company_*_messages'],
            'balance' => 'auto',
            'processes' => 5,
            'tries' => 3,
        ]
    ]
]

Example config for RabbitMQ

Add RabbitMQ connection config to config/queue.php You can get example config from a package maintainer's repo https://github.com/vyuldashev/laravel-queue-rabbitmq/tree/v8.0

Example .env for Redis

QUEUE_CONNECTION=redis
QUEUE_OBSERVER_TIMEOUT=25

Example .env for RabbitMQ

QUEUE_CONNECTION=rabbitmq
QUEUE_OBSERVER_TIMEOUT=25
RABBITMQ_WORKER=horizon
RABBITMQ_API_URL=http://localhost:15672
RABBITMQ_HOST=rabbitmq
RABBITMQ_PORT=5672
RABBITMQ_LOGIN=admin
RABBITMQ_PASSWORD=admin
RABBITMQ_SSL=0
RABBITMQ_QUEUE=default
RABBITMQ_VHOST=/

For additional info refer https://github.com/vyuldashev/laravel-queue-rabbitmq/tree/v8.0

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-19