Skip to content

Commit e9dcd58

Browse files
author
Alex Paliarush
committed
MAGETWO-55730: Remove support of v1 queue config
1 parent fdd0fc8 commit e9dcd58

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

lib/internal/Magento/Framework/Communication/Config/ConfigParser.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
*/
1414
class ConfigParser
1515
{
16+
const TYPE_NAME = 'typeName';
17+
const METHOD_NAME = 'methodName';
18+
1619
/**
1720
* Parse service method name.
1821
*
@@ -34,6 +37,6 @@ public function parseServiceMethod($serviceMethod)
3437
}
3538
$className = $matches[1];
3639
$methodName = $matches[2];
37-
return ['type' => $className, 'method' => $methodName];
40+
return [self::TYPE_NAME => $className, self::METHOD_NAME => $methodName];
3841
}
3942
}

lib/internal/Magento/Framework/Communication/Config/Reader/XmlReader/Converter.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ protected function extractTopics($config)
106106
$serviceMethod = $this->getServiceMethodBySchema($topicNode);
107107
$requestResponseSchema = $serviceMethod
108108
? $this->reflectionGenerator->extractMethodMetadata(
109-
$serviceMethod['type'],
110-
$serviceMethod['method']
109+
$serviceMethod[ConfigParser::TYPE_NAME],
110+
$serviceMethod[ConfigParser::METHOD_NAME]
111111
)
112112
: null;
113113
$requestSchema = $this->extractTopicRequestSchema($topicNode);
@@ -129,8 +129,8 @@ protected function extractTopics($config)
129129
if ($serviceMethod) {
130130
$output[$topicName] = $this->reflectionGenerator->generateTopicConfigForServiceMethod(
131131
$topicName,
132-
$serviceMethod['type'],
133-
$serviceMethod['method'],
132+
$serviceMethod[ConfigParser::TYPE_NAME],
133+
$serviceMethod[ConfigParser::METHOD_NAME],
134134
$handlers
135135
);
136136
} else if ($requestSchema && $responseSchema) {
@@ -239,12 +239,24 @@ protected function getServiceMethodBySchema($topicNode)
239239
}
240240
$topicName = $topicAttributes->getNamedItem('name')->nodeValue;
241241
$serviceMethod = $topicAttributes->getNamedItem('schema')->nodeValue;
242+
return $this->parseServiceMethod($serviceMethod, $topicName);
243+
}
244+
245+
/**
246+
* Parse service method name, also ensure that it exists.
247+
*
248+
* @param string $serviceMethod
249+
* @param string $topicName
250+
* @return array Contains class name and method name
251+
*/
252+
protected function parseServiceMethod($serviceMethod, $topicName)
253+
{
242254
$parsedServiceMethod = $this->getConfigParser()->parseServiceMethod($serviceMethod);
243255
$this->xmlValidator->validateServiceMethod(
244256
$serviceMethod,
245257
$topicName,
246-
$parsedServiceMethod['type'],
247-
$parsedServiceMethod['method']
258+
$parsedServiceMethod[ConfigParser::TYPE_NAME],
259+
$parsedServiceMethod[ConfigParser::METHOD_NAME]
248260
);
249261
return $parsedServiceMethod;
250262
}

0 commit comments

Comments
 (0)