diff --git a/src/Consumer.php b/src/Consumer.php index 8ffff81..c31587a 100644 --- a/src/Consumer.php +++ b/src/Consumer.php @@ -72,6 +72,7 @@ public function daemon($connectionName, $queue, WorkerOptions $workerOptions) $jobsProcessed = 0; $connection = $this->manager->connection($connectionName); + $connection->declareQueue($queue); $this->amqpChannel = $connection->getChannel(); diff --git a/src/RabbitQueue.php b/src/RabbitQueue.php index f49e8c8..ac122b2 100644 --- a/src/RabbitQueue.php +++ b/src/RabbitQueue.php @@ -400,7 +400,7 @@ private function createMessage($payload, int $attempts = 2): array ]; } - private function publishProperties(string $queue = '', array $options = []): array + private function publishProperties(?string $queue = null, array $options = []): array { $queue = $this->getQueue($queue); $attempts = Arr::get($options, 'attempts') ?: 0;