Skip to content

Commit cf9d19a

Browse files
author
Nick
committed
some update
1 parent 79311ee commit cf9d19a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Queue/RabbitMQQueue.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Contracts\Queue\Queue as QueueContract;
1010
use Illuminate\Queue\Queue;
1111
use Illuminate\Support\Arr;
12+
use Illuminate\Support\Facades\Redis;
1213
use Illuminate\Support\Str;
1314
use JsonException;
1415
use PhpAmqpLib\Channel\AMQPChannel;
@@ -120,9 +121,9 @@ public function size($queue = null): int
120121
*
121122
* @throws AMQPProtocolChannelException
122123
*/
123-
public function push($job, $data = '', $queue = null)
124+
public function push($job, $data = '', $queue = null, array $options = [])
124125
{
125-
return $this->pushRaw($this->createPayload($job, $queue, $data), $queue, []);
126+
return $this->pushRaw($this->createPayload($job, $queue, $data), $queue, $options);
126127
}
127128

128129
/**
@@ -215,7 +216,7 @@ public function laterRaw($delay, $payload, $queue = null, $attempts = 0)
215216
[$message, $correlationId] = $this->createMessage($payload, $attempts);
216217

217218
// Publish directly on the delayQueue, no need to publish trough an exchange.
218-
$this->channel->basic_publish($message, null, $destination, true, false);
219+
$this->channel->basic_publish($message, null, $destination, false, false);
219220

220221
return $correlationId;
221222
}
@@ -586,7 +587,7 @@ public function reject(RabbitMQJob $job, bool $requeue = false): void
586587
* @return array
587588
* @throws JsonException
588589
*/
589-
protected function createMessage($payload, int $attempts = 0): array
590+
protected function createMessage($payload, int $attempts = 0, $options = []): array
590591
{
591592
$properties = [
592593
'content_type' => 'application/json',
@@ -892,7 +893,7 @@ protected function publishProperties($queue, array $options = []): array
892893
$queue = $this->getQueue($queue);
893894
$attempts = Arr::get($options, 'attempts') ?: 0;
894895

895-
$destination = $this->getRoutingKey($queue);
896+
$destination = $this->getRoutingKey($queue, $options);
896897
$exchange = $this->getExchange(Arr::get($options, 'exchange'));
897898
$exchangeType = $this->getExchangeType(Arr::get($options, 'exchange_type'));
898899

0 commit comments

Comments
 (0)