Skip to content

Commit 9c9222f

Browse files
dbufabpot
authored andcommitted
[Messenger] helpful exception when requesting an AMQP queue that is not configured
1 parent ffa384d commit 9c9222f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Transport/Connection.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,9 @@ public function channel(): \AMQPChannel
509509
public function queue(string $queueName): \AMQPQueue
510510
{
511511
if (!isset($this->amqpQueues[$queueName])) {
512+
if (!\array_key_exists($queueName, $this->queuesOptions)) {
513+
throw new InvalidArgumentException(sprintf('Exchange "%s" does not have a queue named "%s", known queues are "%s"', $this->exchangeOptions['name'], $queueName, implode('", "', array_keys($this->queuesOptions))));
514+
}
512515
$queueConfig = $this->queuesOptions[$queueName];
513516

514517
$amqpQueue = $this->amqpFactory->createQueue($this->channel());

0 commit comments

Comments
 (0)