From b7a22cde9c32df762290deba3f95668734353a53 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 20 Dec 2018 14:07:24 +0200 Subject: [PATCH] [client] Fix Exclusive Command Extension ignores route queue preifx option. --- .../ConsumptionExtension/ExclusiveCommandExtension.php | 2 +- .../ConsumptionExtension/ExclusiveCommandExtensionTest.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php b/pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php index a76e49f30..7ab88ae0f 100644 --- a/pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php +++ b/pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php @@ -64,7 +64,7 @@ private function buildMap(): array continue; } - $queueName = $this->driver->createQueue($route->getQueue())->getQueueName(); + $queueName = $this->driver->createRouteQueue($route)->getQueueName(); if (array_key_exists($queueName, $map)) { throw new \LogicException('The queue name has been already bound by another exclusive command processor'); } diff --git a/pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php b/pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php index 3e1ef2ba0..877836758 100644 --- a/pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php +++ b/pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php @@ -181,9 +181,10 @@ public function testShouldSetCommandPropertiesIfCurrentQueueHasExclusiveCommandP $driver = $this->createDriverStub($routeCollection); $driver ->expects($this->any()) - ->method('createQueue') - ->willReturnCallback(function (string $queueName) { - return new NullQueue($queueName); + ->method('createRouteQueue') + ->with($this->isInstanceOf(Route::class)) + ->willReturnCallback(function (Route $route) { + return new NullQueue($route->getQueue()); }) ;