Skip to content

Commit 5a753b1

Browse files
committed
minor #33245 [Messenger] remove patch release BC layer of durable and expiring delay (Tobion)
This PR was merged into the 4.4 branch. Discussion ---------- [Messenger] remove patch release BC layer of durable and expiring delay | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | | License | MIT | Doc PR | Removes the small BC layer of #33127 from 4.3 in 4.4 Commits ------- d5aaf44 [Messenger] remove patch release BC layer of durable and expiring delay
2 parents 22319a9 + d5aaf44 commit 5a753b1

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,7 @@ private function getDelayExchange(): \AMQPExchange
251251
$this->amqpDelayExchange = $this->amqpFactory->createExchange($this->channel());
252252
$this->amqpDelayExchange->setName($this->connectionOptions['delay']['exchange_name']);
253253
$this->amqpDelayExchange->setType(AMQP_EX_TYPE_DIRECT);
254-
if ('delays' === $this->connectionOptions['delay']['exchange_name']) {
255-
// 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
256-
// the condition will be removed in 4.4
257-
$this->amqpDelayExchange->setFlags(AMQP_DURABLE);
258-
}
254+
$this->amqpDelayExchange->setFlags(AMQP_DURABLE);
259255
}
260256

261257
return $this->amqpDelayExchange;
@@ -278,24 +274,17 @@ private function createDelayQueue(int $delay, ?string $routingKey)
278274
[$delay, $this->exchangeOptions['name'], $routingKey ?? ''],
279275
$this->connectionOptions['delay']['queue_name_pattern']
280276
));
281-
if ('delay_%exchange_name%_%routing_key%_%delay%' === $this->connectionOptions['delay']['queue_name_pattern']) {
282-
// the condition will be removed in 4.4
283-
$queue->setFlags(AMQP_DURABLE);
284-
$extraArguments = [
285-
// delete the delay queue 10 seconds after the message expires
286-
// publishing another message redeclares the queue which renews the lease
287-
'x-expires' => $delay + 10000,
288-
];
289-
} else {
290-
$extraArguments = [];
291-
}
277+
$queue->setFlags(AMQP_DURABLE);
292278
$queue->setArguments([
293279
'x-message-ttl' => $delay,
280+
// delete the delay queue 10 seconds after the message expires
281+
// publishing another message redeclares the queue which renews the lease
282+
'x-expires' => $delay + 10000,
294283
'x-dead-letter-exchange' => $this->exchangeOptions['name'],
295284
// after being released from to DLX, make sure the original routing key will be used
296285
// we must use an empty string instead of null for the argument to be picked up
297286
'x-dead-letter-routing-key' => $routingKey ?? '',
298-
] + $extraArguments);
287+
]);
299288

300289
return $queue;
301290
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

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:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy