Skip to content

Commit 8037ffb

Browse files
author
Alex Paliarush
committed
MAGETWO-56305: Message Queue Configuration via remote services
- Merge branch 'MAGETWO-56297-Message-Queue-Config' into MAGETWO-56207-multiple-rabbitmq-connections
2 parents e0f7d23 + b6c6928 commit 8037ffb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
class ReflectionGenerator
1515
{
1616
const DEFAULT_HANDLER = 'defaultHandler';
17+
1718
/**
1819
* @var MethodsMap
1920
*/
@@ -79,4 +80,23 @@ public function generateTopicConfigForServiceMethod($topicName, $serviceType, $s
7980
?: [self::DEFAULT_HANDLER => $methodMetadata[Config::SCHEMA_METHOD_HANDLER]]
8081
];
8182
}
83+
84+
/**
85+
* Generate topic name based on service type and method name.
86+
*
87+
* Perform the following conversion:
88+
* \Magento\Customer\Api\RepositoryInterface + getById => magento.customer.api.repositoryInterface.getById
89+
*
90+
* @param string $typeName
91+
* @param string $methodName
92+
* @return string
93+
*/
94+
public function generateTopicName($typeName, $methodName)
95+
{
96+
$parts = explode('\\', ltrim($typeName, '\\'));
97+
foreach ($parts as &$part) {
98+
$part = lcfirst($part);
99+
}
100+
return implode('.', $parts) . '.' . $methodName;
101+
}
82102
}

0 commit comments

Comments
 (0)