Skip to content

Commit d6c3f33

Browse files
committed
Merge remote-tracking branch 'origin/AC-14558-stomp-v2' into Platform_Health_ActiveMQ_Delivery
2 parents 3026734 + db7d79d commit d6c3f33

File tree

112 files changed

+6751
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+6751
-178
lines changed

app/code/Magento/Amqp/Setup/ConfigOptionsList.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class ConfigOptionsList implements ConfigOptionsListInterface
2626
public const INPUT_KEY_QUEUE_AMQP_VIRTUAL_HOST = 'amqp-virtualhost';
2727
public const INPUT_KEY_QUEUE_AMQP_SSL = 'amqp-ssl';
2828
public const INPUT_KEY_QUEUE_AMQP_SSL_OPTIONS = 'amqp-ssl-options';
29+
public const INPUT_KEY_QUEUE_DEFAULT_CONNECTION ='queue-default-connection';
2930

3031
/**
3132
* Path to the values in the deployment config
@@ -203,6 +204,11 @@ public function validate(array $options, DeploymentConfig $deploymentConfig)
203204
if (!$result) {
204205
$errors[] = "Could not connect to the Amqp Server.";
205206
}
207+
208+
if (isset($options[self::INPUT_KEY_QUEUE_DEFAULT_CONNECTION])
209+
&& $options[self::INPUT_KEY_QUEUE_DEFAULT_CONNECTION] !== 'amqp') {
210+
$errors = [];
211+
}
206212
}
207213

208214
return $errors;

app/code/Magento/AsyncConfig/etc/queue_publisher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="async_config.saveConfig"/>
9+
<publisher topic="async_config.saveConfig" queue="saveConfig"/>
1010
</config>

app/code/Magento/AsynchronousOperations/Model/MassConsumer.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77

88
namespace Magento\AsynchronousOperations\Model;
99

10+
use Magento\Framework\App\ObjectManager;
1011
use Magento\Framework\MessageQueue\CallbackInvokerInterface;
1112
use Magento\Framework\MessageQueue\ConsumerConfigurationInterface;
1213
use Magento\Framework\MessageQueue\ConsumerInterface;
1314
use Magento\Framework\MessageQueue\EnvelopeInterface;
1415
use Magento\Framework\MessageQueue\QueueInterface;
1516
use Magento\Framework\Registry;
17+
use Magento\Framework\MessageQueue\Consumer\ConfigInterface as ConsumerConfig;
1618

1719
/**
1820
* Class Consumer used to process OperationInterface messages.
@@ -41,24 +43,32 @@ class MassConsumer implements ConsumerInterface
4143
*/
4244
private $registry;
4345

46+
/**
47+
* @var ConsumerConfig
48+
*/
49+
private $consumerConfig;
50+
4451
/**
4552
* Initialize dependencies.
4653
*
4754
* @param CallbackInvokerInterface $invoker
4855
* @param ConsumerConfigurationInterface $configuration
4956
* @param MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback
5057
* @param Registry $registry
58+
* @param ConsumerConfig|null $consumerConfig
5159
*/
5260
public function __construct(
5361
CallbackInvokerInterface $invoker,
5462
ConsumerConfigurationInterface $configuration,
5563
MassConsumerEnvelopeCallbackFactory $massConsumerEnvelopeCallback,
56-
Registry $registry
64+
Registry $registry,
65+
?ConsumerConfig $consumerConfig = null
5766
) {
5867
$this->invoker = $invoker;
5968
$this->configuration = $configuration;
6069
$this->massConsumerEnvelopeCallback = $massConsumerEnvelopeCallback;
6170
$this->registry = $registry;
71+
$this->consumerConfig = $consumerConfig ?: ObjectManager::getInstance()->get(ConsumerConfig::class);
6272
}
6373

6474
/**
@@ -75,12 +85,16 @@ public function process($maxNumberOfMessages = null)
7585
if (!isset($maxNumberOfMessages)) {
7686
$queue->subscribe($this->getTransactionCallback($queue));
7787
} else {
88+
$connectionName = $this->consumerConfig
89+
->getConsumer($this->configuration->getConsumerName())
90+
->getConnection();
7891
$this->invoker->invoke(
7992
$queue,
8093
$maxNumberOfMessages,
8194
$this->getTransactionCallback($queue),
8295
$maxIdleTime,
83-
$sleep
96+
$sleep,
97+
$connectionName
8498
);
8599
}
86100

app/code/Magento/Catalog/etc/queue_publisher.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="product_action_attribute.update"/>
10-
<publisher topic="product_action_attribute.website.update"/>
11-
<publisher topic="catalog_website_attribute_value_sync"/>
9+
<publisher topic="product_action_attribute.update" queue="product_action_attribute.update"/>
10+
<publisher topic="product_action_attribute.website.update" queue="product_action_attribute.website.update"/>
11+
<publisher topic="catalog_website_attribute_value_sync" queue="catalog_website_attribute_value_sync"/>
1212
</config>

app/code/Magento/CatalogUrlRewrite/etc/queue_publisher.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="catalog_product_generate_urls"/>
9+
<publisher topic="catalog_product_generate_urls" queue="catalog_product_generate_urls"/>
1010
</config>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2017 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="import_export.export"/>
9+
<publisher topic="import_export.export" queue="export"/>
1010
</config>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2020 Adobe
4+
* All Rights Reserved.
55
*/
66
-->
77
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88
xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="media.content.synchronization"/>
9+
<publisher topic="media.content.synchronization" queue="media.content.synchronization"/>
1010
</config>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2020 Adobe
4+
* All Rights Reserved.
55
*/
66
-->
77
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88
xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="media.gallery.renditions.update"/>
9+
<publisher topic="media.gallery.renditions.update" queue="media.gallery.renditions.update"/>
1010
</config>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2020 Adobe
4+
* All Rights Reserved.
55
*/
66
-->
77
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
88
xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="media.gallery.synchronization"/>
9+
<publisher topic="media.gallery.synchronization" queue="media.gallery.synchronization"/>
1010
</config>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0"?>
22
<!--
33
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
4+
* Copyright 2015 Adobe
5+
* All Rights Reserved.
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
9-
<publisher topic="media.storage.catalog.image.resize"/>
9+
<publisher topic="media.storage.catalog.image.resize" queue="media.storage.catalog.image.resize"/>
1010
</config>

0 commit comments

Comments
 (0)