Skip to content

Commit 41f76e7

Browse files
committed
MCP-826: Use RabbitMQ for all consumers if AMQP is set in deployment config
- Fix static tests;
1 parent 910e72f commit 41f76e7

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

dev/tests/integration/testsuite/Magento/Framework/MessageQueue/Consumer/DeprecatedConfigTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Test access to consumer configuration declared in deprecated queue.xml configs using Consumer\ConfigInterface.
1414
*
1515
* @magentoCache config disabled
16+
* @SuppressWarnings(PHPMD)
1617
*/
1718
class DeprecatedConfigTest extends \PHPUnit\Framework\TestCase
1819
{

lib/internal/Magento/Framework/Amqp/Bulk/Exchange.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function __construct(
5757

5858
/**
5959
* @inheritdoc
60+
* @SuppressWarnings(PHPMD)
6061
*/
6162
public function enqueue($topic, array $envelopes)
6263
{
@@ -76,12 +77,10 @@ public function enqueue($topic, array $envelopes)
7677
$exchange = $publisher->getConnection()->getExchange();
7778

7879
foreach ($envelopes as $envelope) {
79-
$properties =[];
80-
$properties['delivery_mode'] = 2;
81-
foreach ($envelope->getProperties() as $key =>$value) {
82-
$properties[$key] = $value;
83-
}
84-
$msg = new AMQPMessage($envelope->getBody(), $properties);
80+
$msg = new AMQPMessage(
81+
$envelope->getBody(),
82+
array_merge(['delivery_mode' => 2], $envelope->getProperties())
83+
);
8584
$channel->batch_basic_publish($msg, $exchange, $topic);
8685
}
8786
$channel->publish_batch();

lib/internal/Magento/Framework/MessageQueue/Config/Reader/Xml/Converter/TopicConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ private function buildConsumers($topics)
164164
*
165165
* @param array $topics
166166
* @return array
167+
* @SuppressWarnings(PHPMD)
167168
*/
168169
private function processWildcard($topics)
169170
{

lib/internal/Magento/Framework/MessageQueue/Topology/Config/Xml/Converter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct(
5858

5959
/**
6060
* @inheritdoc
61-
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
61+
* @SuppressWarnings(PHPMD)
6262
*/
6363
public function convert($source)
6464
{

0 commit comments

Comments
 (0)