Skip to content

Commit 8844519

Browse files
committed
fixes
1 parent f8008a1 commit 8844519

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/VladimirYuldashev/LaravelQueueRabbitMQ/Queue/RabbitMQQueue.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function pushRaw($payload, $queue = null, array $options = [])
7070
if (isset($options['delay']) && $options['delay'] > 0) {
7171
list($queue, $exchange) = $this->declareDelayedQueue($queue, $options['delay']);
7272
} else {
73-
$this->declareQueue($queue);
73+
list($queue, $exchange) = $this->declareQueue($queue);
7474
}
7575
// push job to a queue
7676
$message = new AMQPMessage($payload, [
@@ -79,7 +79,7 @@ public function pushRaw($payload, $queue = null, array $options = [])
7979
]);
8080

8181
// push task to a queue
82-
$this->channel->basic_publish($message, $queue, $queue);
82+
$this->channel->basic_publish($message, $exchange, $queue);
8383

8484
return true;
8585
}
@@ -142,7 +142,7 @@ private function getChannel()
142142
}
143143

144144
/**
145-
* @param string $name
145+
* @return array
146146
*/
147147
private function declareQueue($name)
148148
{
@@ -173,6 +173,8 @@ private function declareQueue($name)
173173
// bind queue to the exchange
174174
$this->channel->queue_bind($name, $exchange, $name);
175175
}
176+
177+
return [$name, $exchange];
176178
}
177179

178180
/**

0 commit comments

Comments
 (0)