This package allows you to listen queues added dynamically by having wildcard *
in queue names in Horizon config file.
You can install the package via composer using the following command:
composer require aloware/horizon-wildcard-consumer
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.
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,
]
]
]
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
QUEUE_CONNECTION=redis
QUEUE_OBSERVER_TIMEOUT=25
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