Skip to content

Commit bbd367b

Browse files
authored
Merge pull request #701 from php-enqueue/client-fix-exclusive-command-extension-ignores-prefix-option
[client] Fix Exclusive Command Extension ignores route queue prefix option.
2 parents 00902a1 + b7a22cd commit bbd367b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: pkg/enqueue/Client/ConsumptionExtension/ExclusiveCommandExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function buildMap(): array
6464
continue;
6565
}
6666

67-
$queueName = $this->driver->createQueue($route->getQueue())->getQueueName();
67+
$queueName = $this->driver->createRouteQueue($route)->getQueueName();
6868
if (array_key_exists($queueName, $map)) {
6969
throw new \LogicException('The queue name has been already bound by another exclusive command processor');
7070
}

Diff for: pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,10 @@ public function testShouldSetCommandPropertiesIfCurrentQueueHasExclusiveCommandP
181181
$driver = $this->createDriverStub($routeCollection);
182182
$driver
183183
->expects($this->any())
184-
->method('createQueue')
185-
->willReturnCallback(function (string $queueName) {
186-
return new NullQueue($queueName);
184+
->method('createRouteQueue')
185+
->with($this->isInstanceOf(Route::class))
186+
->willReturnCallback(function (Route $route) {
187+
return new NullQueue($route->getQueue());
187188
})
188189
;
189190

0 commit comments

Comments
 (0)