@@ -142,6 +142,7 @@ public function __construct(array $connectionOptions, array $exchangeOptions, ar
142
142
* * delay:
143
143
* * queue_name_pattern: Pattern to use to create the queues (Default: "delay_%exchange_name%_%routing_key%_%delay%")
144
144
* * exchange_name: Name of the exchange to be used for the delayed/retried messages (Default: "delays")
145
+ * * arguments: array of extra delay queue arguments (for example: ['x-queue-type' => 'classic', 'x-message-deduplication' => true,])
145
146
* * auto_setup: Enable or not the auto-setup of queues and exchanges (Default: true)
146
147
*
147
148
* * Connection tuning options (see http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune for details):
@@ -386,7 +387,7 @@ private function createDelayQueue(int $delay, ?string $routingKey, bool $isRetry
386
387
$ queue = $ this ->amqpFactory ->createQueue ($ this ->channel ());
387
388
$ queue ->setName ($ this ->getRoutingKeyForDelay ($ delay , $ routingKey , $ isRetryAttempt ));
388
389
$ queue ->setFlags (\AMQP_DURABLE );
389
- $ queue ->setArguments ([
390
+ $ queue ->setArguments (array_merge ( [
390
391
'x-message-ttl ' => $ delay ,
391
392
// delete the delay queue 10 seconds after the message expires
392
393
// publishing another message redeclares the queue which renews the lease
@@ -397,7 +398,7 @@ private function createDelayQueue(int $delay, ?string $routingKey, bool $isRetry
397
398
// after being released from to DLX, make sure the original routing key will be used
398
399
// we must use an empty string instead of null for the argument to be picked up
399
400
'x-dead-letter-routing-key ' => $ routingKey ?? '' ,
400
- ]);
401
+ ], $ this -> connectionOptions [ ' delay ' ][ ' arguments ' ] ?? []) );
401
402
402
403
return $ queue ;
403
404
}
0 commit comments