Skip to content

Commit 6d56d03

Browse files
authored
declareQueue using wrong queue object
- Issue When starting laravel worker using laravel-queue, this error is produced: ``` [2019-01-24 00:48:33] laravel.ERROR: Argument 1 passed to Enqueue\AmqpLib\AmqpContext::declareQueue() must implement interface Interop\Amqp\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Argument 1 passed to Enqueue\\AmqpLib\\AmqpContext::declareQueue() must implement interface Interop\\Amqp\\AmqpQueue, string given, called in /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php on line 61 at /var/www/html/vendor/enqueue/amqp-lib/AmqpContext.php:163) [stacktrace] #0 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(61): Enqueue\\AmqpLib\\AmqpContext->declareQueue('wat') #1 /var/www/html/vendor/enqueue/laravel-queue/src/AmqpQueue.php(47): Enqueue\\LaravelQueue\\AmqpQueue->declareQueue('wat') #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(247): Enqueue\\LaravelQueue\\AmqpQueue->pop('wat') ``` `AmqpContext->declareQueue` is expecting the `Interop\Amqp\AmqpQueue` retrieved on line 57; however, the queue name as a string is passed instead. - Fix Pass `$interopQueue` to `AmqpContext->declareQueue`.
1 parent a9384d1 commit 6d56d03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AmqpQueue.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ protected function declareQueue($queue = null)
5757
$interopQueue = $this->getQueue($queue);
5858
$interopQueue->addFlag(\Interop\Amqp\AmqpQueue::FLAG_DURABLE);
5959

60-
$this->getQueueInteropContext()->declareQueue($queue);
60+
$this->getQueueInteropContext()->declareQueue($interopQueue);
6161
}
6262
}

0 commit comments

Comments
 (0)