magento2: Queue consumer handler can't be virtual type
Preconditions (*)
- Magento 2.3.3
- Rabbit MQ 3.7.8
Steps to reproduce (*)
- In custom module add consumer in
queue_consumer.xml
for any queue - Consumer should be virtual type
- Start consumer from console
Expected result (*)
- Consumer handles message
Actual result (*)
- Consumer is not started
- There is error in console: "Service method specified as handler for of consumer “<name>” is not available. Given “<class>::<method>”
The problem sems to be in here vendor/magento/framework-message-queue/Consumer/Config/Validator/Handlers.php. MethodsMap
tries to load class with reflection (vendor/magento/framework/Reflection/MethodsMap.php:130
) and fails because virtual type in fact doesn’t exists.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15 (6 by maintainers)
⬆️ Looks like the issue is not resolved, is being reproduced, and still requires an attention
It’s still possible to reproduce this issue on Magento 2.4.0 Enterprise
How to reproduce
setup:di:compile
finished successfullybin/magento queue:consumers:start testConsumer
and see the errorThis happens because it tries to create ClassReflection for virtual type in vendor/magento/framework/Reflection/MethodsMap.php:137 And I see that code which is responsible for that is still exists in the latest magento 2.4-develop branch - https://github.com/magento/magento2/blob/2.4-develop/lib/internal/Magento/Framework/MessageQueue/Consumer/Config/Validator/Handlers.php#L72
@engcom-Hotel I didn’t have time recently to check it again. I was waiting for your response for over one year, so I don’t think this should be closed just like this. I am going to examine that in two next week, so you can reopen this one.