6

Magento has some core queues like:

  • catalog_product_removed_queue
  • codegenerator
  • export
  • inventory.mass.update
  • inventory.reservations.cleanup
  • inventory.reservations.update
  • inventory.source.items.cleanup
  • inventory_qty_counter_queue
  • product_action_attribute.update
  • product_action_attribute.website.update

Magento uses MySQL tables for managing asynchronous operations by default. Because these queues defined with connection="db" in queue.xml.

Is there a way to use RabbitMQ for these core queues without editing for Magento's core files like vendor/magento/module-catalog/etc/queue.xml. Can we override connection type of these queues?

2

You should be able to override the connection type for these queues in env.php or config.php like so:

Change message queue from MySQL to AMQP

The following sample introduces a runtime configuration that allows you to redefine the adapter for a topic.

'queue' => [
    'topics' => [
        'product_action_attribute.update' => [
            'publisher' => 'amqp-magento'
        ]
    ],
    'config' => [
        'publishers' => [
            'product_action_attribute.update' => [
                'connections' => [
                    'amqp' => [
                        'name' => 'amqp',
                        'exchange' => 'magento',
                        'disabled' => false
                    ],
                    'db' => [
                        'name' => 'db',
                        'disabled' => true
                    ]
                ]
            ]
        ]
    ],
    'consumers' => [
        'product_action_attribute.update' => [
            'connection' => 'amqp',
        ],
    ],
],

Source: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/message-queues/message-queues.html

Moreover, you can create your own module that has a queue.xml (or better yet, queue_consumer.xml, queue_publisher.xml and queue_topology.xml files) that overrides Magento's core values. This is possible, because the XML is merged according to the module loading order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.