Closed
Description
The xml validator fail when you pass a class with numeric value in it's namespace.
Preconditions
Magento 2.2.2
magento/framework-message-queue
Steps to reproduce
- Create etc/queue.xml file
<broker topic="xxxx" type="amqp" exchange="magento">
<queue consumer="yyyy" name="zzzz" handler="Vendor\Xxx5\Model\Consumer::processMessage" consumerInstance="Magento\Framework\MessageQueue\Consumer"/>
</broker>
- Run
bin/magento setup:upgrade
Actual result
The value 'Vendor\Xxx5\Model\Queue\Consumer::processMessage' is not accepted by the pattern '[a-zA-Z\]+::[a-zA-Z]+'.
Work arround
Created a virtualType for my class without a number in it's namespace
Solution
At vendor/magento/framework-message-queue/etc/queue_base.xsd
<xs:simpleType name="handlerType">
<xs:annotation>
<xs:documentation>
@deprecated
Handler is expected in a format "Vendor\Module\Api\ServiceName::methodName".
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z\\]+::[a-zA-Z]+" />
<xs:minLength value="5" />
</xs:restriction>
</xs:simpleType>
Fix the pattern to accept numbers (Make sure it doesn't allow start with number)
[a-zA-Z]+[a-zA-Z0-9\\]+::[a-zA-Z0-9]+
should work