Skip to content

Commit 7c9f0c9

Browse files
author
Devon Weller
committed
support priority queues
1 parent 71b38d8 commit 7c9f0c9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Queue/RabbitMQQueue.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ public function pushRaw($payload, $queueName = null, array $options = [])
8585
$message->setProperty(RabbitMQJob::ATTEMPT_COUNT_HEADERS_KEY, $options['attempts']);
8686
}
8787

88+
// set priority
89+
if (isset($options['priority']) && $options['priority'] > 0) {
90+
$message->setPriority($options['priority']);
91+
}
92+
8893
$producer = $this->context->createProducer();
8994
if (isset($options['delay']) && $options['delay'] > 0) {
9095
$producer->setDeliveryDelay($options['delay'] * 1000);

0 commit comments

Comments
 (0)