diff --git a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php index 6a372152420c7..63c1fafdd50de 100644 --- a/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php @@ -251,11 +251,7 @@ private function getDelayExchange(): \AMQPExchange $this->amqpDelayExchange = $this->amqpFactory->createExchange($this->channel()); $this->amqpDelayExchange->setName($this->connectionOptions['delay']['exchange_name']); $this->amqpDelayExchange->setType(AMQP_EX_TYPE_DIRECT); - if ('delays' === $this->connectionOptions['delay']['exchange_name']) { - // only add the new flag when the name was not provided explicitly so we're using the new default name to prevent a redeclaration error - // the condition will be removed in 4.4 - $this->amqpDelayExchange->setFlags(AMQP_DURABLE); - } + $this->amqpDelayExchange->setFlags(AMQP_DURABLE); } return $this->amqpDelayExchange; @@ -278,24 +274,17 @@ private function createDelayQueue(int $delay, ?string $routingKey) [$delay, $this->exchangeOptions['name'], $routingKey ?? ''], $this->connectionOptions['delay']['queue_name_pattern'] )); - if ('delay_%exchange_name%_%routing_key%_%delay%' === $this->connectionOptions['delay']['queue_name_pattern']) { - // the condition will be removed in 4.4 - $queue->setFlags(AMQP_DURABLE); - $extraArguments = [ - // delete the delay queue 10 seconds after the message expires - // publishing another message redeclares the queue which renews the lease - 'x-expires' => $delay + 10000, - ]; - } else { - $extraArguments = []; - } + $queue->setFlags(AMQP_DURABLE); $queue->setArguments([ 'x-message-ttl' => $delay, + // delete the delay queue 10 seconds after the message expires + // publishing another message redeclares the queue which renews the lease + 'x-expires' => $delay + 10000, 'x-dead-letter-exchange' => $this->exchangeOptions['name'], // after being released from to DLX, make sure the original routing key will be used // we must use an empty string instead of null for the argument to be picked up 'x-dead-letter-routing-key' => $routingKey ?? '', - ] + $extraArguments); + ]); return $queue; }
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: