Skip to content

Commit adb5205

Browse files
author
Alex Rutski
committed
SWR-18735: make vhost prefix configurable from env
1 parent ba5b8eb commit adb5205

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config/rabbitmq.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@
3030
*/
3131
'worker' => env('RABBITMQ_WORKER', 'default'),
3232

33+
/*
34+
* Vhost prefix for organization-specific vhosts.
35+
*/
36+
'vhost_prefix' => env('RABBITMQ_VHOST_PREFIX', 'organization_'),
37+
3338
];

src/Services/VhostsService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
class VhostsService
1111
{
12-
public const VHOST_PREFIX = 'organization_';
13-
1412
/**
1513
* @param RabbitApiClient $rabbitApiClient
1614
* @param LoggerInterface $logger
@@ -204,7 +202,9 @@ public function setVhostPermissions(string $vhostName): bool
204202
*/
205203
public function getVhostName(int $organizationId): string
206204
{
207-
return self::VHOST_PREFIX . $organizationId;
205+
$vhostPrefix = config('queue.connections.rabbitmq_vhosts.vhost_prefix', 'organization_');
206+
207+
return $vhostPrefix . $organizationId;
208208
}
209209

210210
/**

0 commit comments

Comments
 (0)