@@ -142,6 +142,7 @@ public function __construct(array $connectionOptions, array $exchangeOptions, ar
142142 * * delay:
143143 * * queue_name_pattern: Pattern to use to create the queues (Default: "delay_%exchange_name%_%routing_key%_%delay%")
144144 * * 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,])
145146 * * auto_setup: Enable or not the auto-setup of queues and exchanges (Default: true)
146147 *
147148 * * 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
386387 $ queue = $ this ->amqpFactory ->createQueue ($ this ->channel ());
387388 $ queue ->setName ($ this ->getRoutingKeyForDelay ($ delay , $ routingKey , $ isRetryAttempt ));
388389 $ queue ->setFlags (\AMQP_DURABLE );
389- $ queue ->setArguments ([
390+ $ queue ->setArguments (array_merge ( [
390391 'x-message-ttl ' => $ delay ,
391392 // delete the delay queue 10 seconds after the message expires
392393 // publishing another message redeclares the queue which renews the lease
@@ -397,7 +398,7 @@ private function createDelayQueue(int $delay, ?string $routingKey, bool $isRetry
397398 // after being released from to DLX, make sure the original routing key will be used
398399 // we must use an empty string instead of null for the argument to be picked up
399400 'x-dead-letter-routing-key ' => $ routingKey ?? '' ,
400- ]);
401+ ], $ this -> connectionOptions [ ' delay ' ][ ' arguments ' ] ?? []) );
401402
402403 return $ queue ;
403404 }
0 commit comments