Skip to content

Commit 39dd6a0

Browse files
committed
MCP-826: Use RabbitMQ for all consumers if AMQP is set in deployment config
- Fix static tests
1 parent bc75e82 commit 39dd6a0

File tree

10 files changed

+21
-27
lines changed

10 files changed

+21
-27
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ class ConfigOptionsList implements ConfigOptionsListInterface
2222
/**
2323
* Input key for the option
2424
*/
25-
const INPUT_KEY_QUEUE_CONSUMERS_WAIT_FOR_MESSAGES ='consumers-wait-for-messages';
26-
const INPUT_KEY_QUEUE_DEFAULT_CONNECTION ='default-connection';
25+
public const INPUT_KEY_QUEUE_CONSUMERS_WAIT_FOR_MESSAGES ='consumers-wait-for-messages';
26+
public const INPUT_KEY_QUEUE_DEFAULT_CONNECTION ='default-connection';
2727

2828
/**
2929
* Path to the values in the deployment config
3030
*/
31-
const CONFIG_PATH_QUEUE_CONSUMERS_WAIT_FOR_MESSAGES = 'queue/consumers_wait_for_messages';
32-
const CONFIG_PATH_QUEUE_DEFAULT_CONNECTION = 'queue/default_connection';
31+
public const CONFIG_PATH_QUEUE_CONSUMERS_WAIT_FOR_MESSAGES = 'queue/consumers_wait_for_messages';
32+
public const CONFIG_PATH_QUEUE_DEFAULT_CONNECTION = 'queue/default_connection';
3333

3434
/**
3535
* Default value
3636
*/
37-
const DEFAULT_CONSUMERS_WAIT_FOR_MESSAGES = 1;
38-
const DEFAULT_QUEUE_CONNECTION = 'db';
37+
public const DEFAULT_CONSUMERS_WAIT_FOR_MESSAGES = 1;
38+
public const DEFAULT_QUEUE_CONNECTION = 'db';
3939

4040
/**
4141
* The available configuration values

app/code/Magento/MysqlMq/Model/ConnectionTypeResolver.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
class ConnectionTypeResolver implements ConnectionTypeResolverInterface
1414
{
1515
/**
16-
* DB connection names.
17-
*
1816
* @var string[]
1917
*/
2018
private $dbConnectionNames;
@@ -31,7 +29,7 @@ public function __construct(array $dbConnectionNames = [])
3129
}
3230

3331
/**
34-
* {@inheritdoc}
32+
* @inheritdoc
3533
*/
3634
public function getConnectionType($connectionName)
3735
{

lib/internal/Magento/Framework/Amqp/ConnectionTypeResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function __construct(DeploymentConfig $deploymentConfig)
4040
}
4141

4242
/**
43-
* {@inheritdoc}
43+
*
44+
* @inheritdoc
4445
* @since 103.0.0
4546
*/
4647
public function getConnectionType($connectionName)

lib/internal/Magento/Framework/Data/Argument/Interpreter/Constant.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
class Constant implements InterpreterInterface
1414
{
1515
/**
16-
* {@inheritdoc}
16+
*
17+
* @inheritdoc
1718
* @return mixed
1819
* @throws \InvalidArgumentException
1920
*/

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
*/
2222
class TopicConfig implements \Magento\Framework\Config\ConverterInterface
2323
{
24-
const DEFAULT_TYPE = 'db';
25-
const DEFAULT_EXCHANGE = 'magento';
26-
const DEFAULT_INSTANCE = ConsumerInterface::class;
24+
public const DEFAULT_TYPE = 'db';
25+
public const DEFAULT_EXCHANGE = 'magento';
26+
public const DEFAULT_INSTANCE = ConsumerInterface::class;
2727

2828
/**
2929
* @var Validator
@@ -41,7 +41,6 @@ class TopicConfig implements \Magento\Framework\Config\ConverterInterface
4141
private $communicationConfig;
4242

4343
/**
44-
* Default value provider.
4544
*
4645
* @var DefaultValueProvider
4746
*/
@@ -69,7 +68,7 @@ public function __construct(
6968
}
7069

7170
/**
72-
* {@inheritDoc}
71+
* @inheritDoc
7372
*/
7473
public function convert($source)
7574
{

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ class Converter implements \Magento\Framework\Config\ConverterInterface
2626
private $configParser;
2727

2828
/**
29-
* Default value provider.
30-
*
3129
* @var DefaultValueProvider
3230
*/
3331
private $defaultValueProvider;

lib/internal/Magento/Framework/MessageQueue/MessageIdGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(
2727
}
2828

2929
/**
30-
* {@inheritdoc}
30+
* @inheritdoc
3131
*/
3232
public function generate($topicName)
3333
{

lib/internal/Magento/Framework/MessageQueue/Publisher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct(
7272
}
7373

7474
/**
75-
* {@inheritdoc}
75+
* @inheritdoc
7676
*/
7777
public function publish($topicName, $data)
7878
{
@@ -85,7 +85,7 @@ public function publish($topicName, $data)
8585
'delivery_mode' => 2,
8686
// md5() here is not for cryptographic use.
8787
// phpcs:ignore Magento2.Security.InsecureFunction
88-
'message_id' => md5(gethostname() . microtime(true) . uniqid($topicName,true))
88+
'message_id' => md5(gethostname() . microtime(true) . uniqid($topicName, true))
8989
]
9090
]
9191
);

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class Converter implements \Magento\Framework\Config\ConverterInterface
2121
private $booleanUtils;
2222

2323
/**
24-
* Default value provider.
25-
*
2624
* @var DefaultValueProvider
2725
*/
2826
private $defaultValueProvider;
@@ -40,7 +38,7 @@ public function __construct(BooleanUtils $booleanUtils, DefaultValueProvider $de
4038
}
4139

4240
/**
43-
* {@inheritdoc}
41+
* @inheritdoc
4442
*/
4543
public function convert($source)
4644
{

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class Converter implements \Magento\Framework\Config\ConverterInterface
3030
private $booleanUtils;
3131

3232
/**
33-
* Argument interpreter.
34-
*
3533
* @var InterpreterInterface
3634
*/
3735
private $argumentInterpreter;
@@ -59,7 +57,8 @@ public function __construct(
5957
}
6058

6159
/**
62-
* {@inheritdoc}
60+
* @inheritdoc
61+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
6362
*/
6463
public function convert($source)
6564
{

0 commit comments

Comments
 (0)