Question

I'm a little bit frustrated with Magento 2 queue for RabbitMQ.

I have setup RabbitMQ, my env.php has such lines

'queue' => [
    'consumers_wait_for_messages' => 1,
    'amqp' => [
        'host' => 'rabbitmq',
        'port' => '5672',
        'user' => 'magento',
        'password' => 'magento',
        'virtualhost' => '/'
    ]
],
'cron_consumers_runner' => [
    'cron_run' => true,
    'max_messages' => 20000,
    'consumers' => []
],  

but I see only async.operations.all in rabbitmqctl list_queues:

/ # rabbitmqctl list_queues
Timeout: 60.0 seconds ...
Listing queues for vhost / ...
name    messages
async.operations.all

Looks like queue is working, but why I don't see any other Magento 2 records in queue? Like
product_action_attribute.update
product_action_attribute.website.update
Strange that I see new queue messages in queue_message table in Magento DB. I see that some of items have connection="db" in queue_topology.xml. Are they executed using RabbitMQ or using Magento own queue implementation?

Was it helpful?

Solution

By default, all of Magento's default queues are defined with a db connection. The only one with a configured amqp connection is the 'async.operations.all' queue.

However, you can move the queues to amqp connection. Check the Magento official documentation on how to change this. The configurations mentioned there should be usable if added to your app/etc/env.php.

Good luck!


LE I can confirm you can do this :) out of curiosity I just moved all my magento instance's queues to RabbitMQ. Here is a gist with my configuration of the Open Source 2.4.1 queues moved to Rabbit. However, this is just the proof of concept about how can you do this and not a complete validation regarding performance for example.

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