Magento 2 Type Error occurred when creating object: Magento\Framework\MessageQueue\Consumer\Config\Data

magento.stackexchange https://magento.stackexchange.com/questions/332683

  •  15-04-2021
  •  | 
  •  

Question

I've gone through the Megento Message queue process. I learned and tried one sample module in my local. but while run the queue:consumers:list command I am facing the following error.

In AbstractFactory.php line 131: Type Error occurred when creating object: Magento\Framework\MessageQueue\Consumer\Config\Data

For your further reference here I've added all my consumer related XML files. I hope this information are sufficient to identify the bug from your end. if you need any other info let me know it.

communication.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Communication/etc/communication.xsd">
    <topic name="product_import_topic" request="string"/>
</config>

queue_publisher:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/publisher.xsd">
    <publisher topic="product_import_topic">
        <connection name="amqp" exchange="product_import_exchange" />
    </publisher>
</config>

queue_topology:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/topology.xsd">
    <exchange name="product_import_exchange" type="topic" connection="amqp">
        <binding id="productImportBiding" topic="product_import_topic" destinationType="queue" destination="product_import_queue"/>
    </exchange>
</config>

queue_consumer.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework-message-queue:etc/consumer.xsd">
    <consumer name="productImportConsumer" queue="product_import_queue" connection="amqp" handler="Practise\MesssageQueue\Model\Consumer\ImportProductConsumer::productImportProcess"/>
</config>

Thanks in advance for your better support.

Was it helpful?

Solution

I can't see any obvious problems with the configuration you posted. Perhaps the problem lies with your consumer code.

I created a message queue test module which might help you test/debug your message queue module and configuration.

https://github.com/gaiterjones/Magento2_Gaiterjones_Rabbitmq

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top