Skip to content

Commit f5da26a

Browse files
author
Alex Paliarush
committed
MAGETWO-56305: Message Queue Configuration via remote services
1 parent feeadbe commit f5da26a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,23 @@ public function generateTopicConfigForServiceMethod($topicName, $serviceType, $s
7979
?: [self::DEFAULT_HANDLER => $methodMetadata[Config::SCHEMA_METHOD_HANDLER]]
8080
];
8181
}
82+
83+
/**
84+
* Generate topic name based on service type and method name.
85+
*
86+
* Perform the following conversion:
87+
* \Magento\Customer\Api\RepositoryInterface + getById => magento.customer.api.repositoryInterface.getById
88+
*
89+
* @param string $typeName
90+
* @param string $methodName
91+
* @return string
92+
*/
93+
public function generateTopicName($typeName, $methodName)
94+
{
95+
$parts = explode('\\', ltrim($typeName, '\\'));
96+
foreach ($parts as &$part) {
97+
$part = lcfirst($part);
98+
}
99+
return implode('.', $parts) . '.' . $methodName;
100+
}
82101
}

0 commit comments

Comments
 (0)