Skip to content

Commit a47be79

Browse files
author
Valentin Nazarov
committed
Remove prioritized option, use x-max-priority
1 parent 664d310 commit a47be79

File tree

2 files changed

+0
-62
lines changed

2 files changed

+0
-62
lines changed

src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -209,60 +209,6 @@ public function testSetsParametersOnTheQueueAndExchange()
209209
$connection->publish('body');
210210
}
211211

212-
public function testSetsMaxPriorityArgumentForQueueWithEnabledPriority()
213-
{
214-
$factory = new TestAmqpFactory(
215-
$amqpConnection = $this->createMock(\AMQPConnection::class),
216-
$amqpChannel = $this->createMock(\AMQPChannel::class),
217-
$amqpQueue = $this->createMock(\AMQPQueue::class),
218-
$amqpExchange = $this->createMock(\AMQPExchange::class)
219-
);
220-
221-
$amqpQueue->expects($this->once())->method('setArguments')->with([
222-
'x-max-priority' => 255,
223-
]);
224-
225-
$dsn = 'amqp://localhost/%2f/messages?'.
226-
'queues[messages][prioritized]=true';
227-
$connection = Connection::fromDsn($dsn, [
228-
'queues' => [
229-
'messages' => [
230-
'prioritized' => 'true',
231-
],
232-
],
233-
], $factory);
234-
$connection->publish('body');
235-
}
236-
237-
public function testDoesNotOverrideMaxPriorityArgumentForQueueWithEnabledPriority()
238-
{
239-
$factory = new TestAmqpFactory(
240-
$amqpConnection = $this->createMock(\AMQPConnection::class),
241-
$amqpChannel = $this->createMock(\AMQPChannel::class),
242-
$amqpQueue = $this->createMock(\AMQPQueue::class),
243-
$amqpExchange = $this->createMock(\AMQPExchange::class)
244-
);
245-
246-
$amqpQueue->expects($this->once())->method('setArguments')->with([
247-
'x-max-priority' => 127,
248-
]);
249-
250-
$dsn = 'amqp://localhost/%2f/messages?'.
251-
'queues[messages][prioritized]=true&'.
252-
'queues[messages][arguments][x-max-priority]=127';
253-
$connection = Connection::fromDsn($dsn, [
254-
'queues' => [
255-
'messages' => [
256-
'prioritized' => 'true',
257-
'arguments' => [
258-
'x-max-priority' => '127',
259-
],
260-
],
261-
],
262-
], $factory);
263-
$connection->publish('body');
264-
}
265-
266212
public function invalidQueueArgumentsDataProvider(): iterable
267213
{
268214
$baseDsn = 'amqp://localhost/%2f/messages';

src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,8 @@ class Connection
6565
'binding_arguments',
6666
'flags',
6767
'arguments',
68-
'prioritized',
6968
];
7069

71-
private const DEFAULT_QUEUE_MAX_PRIORITY = 255;
72-
7370
private const AVAILABLE_EXCHANGE_OPTIONS = [
7471
'name',
7572
'type',
@@ -142,7 +139,6 @@ public function __construct(array $connectionOptions, array $exchangeOptions, ar
142139
* * binding_arguments: Arguments to be used while binding the queue.
143140
* * flags: Queue flags (Default: AMQP_DURABLE)
144141
* * arguments: Extra arguments
145-
* * prioritized: Enables priority queue. Does not override x-max-priority argument, if it was set (Default: false)
146142
* * exchange:
147143
* * name: Name of the exchange
148144
* * type: Type of exchange (Default: fanout)
@@ -224,10 +220,6 @@ public static function fromDsn(string $dsn, array $options = [], AmqpFactory $am
224220
if (\is_array($queueOptions['arguments'] ?? false)) {
225221
$queueOptions['arguments'] = self::normalizeQueueArguments($queueOptions['arguments']);
226222
}
227-
$prioritized = filter_var($queueOptions['prioritized'] ?? false, \FILTER_VALIDATE_BOOLEAN);
228-
if ($prioritized && !isset($queueOptions['arguments']['x-max-priority'])) {
229-
$queueOptions['arguments']['x-max-priority'] = self::DEFAULT_QUEUE_MAX_PRIORITY;
230-
}
231223

232224
return $queueOptions;
233225
}, $queuesOptions);

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