mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added dependencies and config to integrate with Rabbit MQ
This commit is contained in:
49
config/autoload/rabbit.global.php
Normal file
49
config/autoload/rabbit.global.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Laminas\ServiceManager\AbstractFactory\ConfigAbstractFactory;
|
||||
use Laminas\ServiceManager\Proxy\LazyServiceFactory;
|
||||
use PhpAmqpLib\Connection\AMQPStreamConnection;
|
||||
|
||||
use function Shlinkio\Shlink\Common\env;
|
||||
|
||||
return [
|
||||
|
||||
'rabbit' => [
|
||||
'host' => env('RABBITMQ_HOST'),
|
||||
'port' => env('RABBITMQ_PORT', '5672'),
|
||||
'user' => env('RABBITMQ_USER'),
|
||||
'password' => env('RABBITMQ_PASSWORD'),
|
||||
'vhost' => env('RABBITMQ_VHOST', '/'),
|
||||
'exchange' => env('RABBITMQ_EXCHANGE', 'shlink-exchange'),
|
||||
'queue' => env('RABBITMQ_QUEUE', 'shlink-queue'),
|
||||
],
|
||||
|
||||
'dependencies' => [
|
||||
'factories' => [
|
||||
AMQPStreamConnection::class => ConfigAbstractFactory::class,
|
||||
],
|
||||
'delegators' => [
|
||||
AMQPStreamConnection::class => [
|
||||
LazyServiceFactory::class,
|
||||
],
|
||||
],
|
||||
'lazy_services' => [
|
||||
'class_map' => [
|
||||
AMQPStreamConnection::class => AMQPStreamConnection::class,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
ConfigAbstractFactory::class => [
|
||||
AMQPStreamConnection::class => [
|
||||
'config.rabbit.host',
|
||||
'config.rabbit.port',
|
||||
'config.rabbit.user',
|
||||
'config.rabbit.password',
|
||||
'config.rabbit.vhost',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
13
config/autoload/rabbit.local.php.dist
Normal file
13
config/autoload/rabbit.local.php.dist
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
|
||||
'rabbit' => [
|
||||
'host' => 'shlink_rabbitmq',
|
||||
'user' => 'rabbit',
|
||||
'password' => 'rabbit',
|
||||
],
|
||||
|
||||
];
|
||||
Reference in New Issue
Block a user