0

Does Magento 2.4.2 (2.4.x) open source REQUIRE asynchronous message queueing (and thus installation of RabbitMQ) by default?

I was under the impression that 'asynchronous message queueing' is an option and not a requirement.

But after installation I see a common error out there with ["async.operations.all" skipped as required connection "amqp" is not configured"]. With this error log message it seems the default installation requires amqp (Async message queue protocol) connection configuration and thus RabbitMQ -- as a default setup -- which means Asynchronous message queueing is REQUIRED for Magento 2.4 to work in a base/default setup.

Is this correct? AMQP and RabbitMQ are REQUIRED (not an option)?

I see lots of confusion on the net about this .. including this thread: Consumer "async.operations.all" skipped as required connection "amqp" is not configured. Unknown connection name amqp

But in the above thread there doesn't seem to be a consensus. It seems to me so far that RabbitMQ is required by default for Magento 2.4 to work properly. Can anyone confirm?

Thanks In Advance

Ray

0

The error appears indeed if you don't have an amqp connection configured to point to rabbit message broker. And will appear indefinitely (if you don't set up the connection) as this is triggered by a Magento cron which processes the bulk update operations (please refer to https://devdocs.magento.com/guides/v2.4/extension-dev-guide/message-queues/bulk-operations.html for further details).

If you don't use bulk operations at all, you can omit installing rabbitmq, but you will see that error log message forever. But if instead you are using bulk operations in your project, then you MUST install rabbitmq, otherwise, these operations won't be processed at all.


LE: The official documentation says you have to add the queue section in the app/etc/env.php file, but if it exists, you just have to add under it the amqp key and configure it. It will look something like this:

[
(...)
    'queue' => [
        (...)
        'amqp' => [
            'host' => '<rabbitmq_host>',
            'port' => '<rabbitmq_port>',
            'user' => '<rabbitmq_user>',
            'password' => '<rabbitmq_pass>',
            'virtualhost' => '/',
            'ssl' => true
        ],
   ]
]

Now, if you check the registered consumers from a vanilla Magento installation, you will see that only the async.operations.all one is set to have an AMQP connection:

<consumer name="async.operations.all" queue="async.operations.all" connection="amqp"
             consumerInstance="Magento\AsynchronousOperations\Model\MassConsumer"/>

all other default consumers will be processed by from the db registered queues and will have no interference whatsoever with rabbitmq. they will continue to work as they did before you configured your amqp connection - only the bulk operations will be processed via the queue registered in rabbitmq.

8
  • Thanx. So, default installation of open-source RabbitMQ is needed for Bulk Operations - OK. Based on this, some operations (BULK) will use 'ampq / RabbitMQ' for Asynchronous communication while the rest continue to be Synchronous via MySQL? ... Doc says to "ADD" a 'queue' section to app/etc/env.php -- BUT a queue section already exists: 'queue' => [ 'consumers_wait_for_messages' => 1 ], devdocs.magento.com/guides/v2.4/install-gde/prereq/… ... So CHANGEING that to 'amqp' method will force ALL comm to be Async? Thus needing further configuration now?
    – RayS
    Jun 17 at 18:06
  • please check the update in my answer :) hopefully, it will make more sense now what you have to do and how this works. cheers and good luck! Jun 18 at 6:41
  • Just to confirm: My queue is: 'queue' => ['consumers_wait_for_messages' => 1], APPENDED: 'queue' => [ 'consumers_wait_for_messages' => 1, 'amqp' => [ ...
    – RayS
    Jun 18 at 23:04
  • yeah, looks good Jun 19 at 16:35
  • 1
    I had to create that in the Rabbit MQ admin panel. Thank you. All good now.
    – RayS
    Jun 30 at 20:52
0

COMPLETE ANSWER PER DIANA'S HELP:

  1. Default Magneto opensource requires amqp (RabbitMQ) for async.operations.all

  2. If you installed Magento before installing your 'amqp' (RabbitMQ) you need to append the 'queue' section in app/etc/env.php with your 'amqp' credentials as follows:

    'queue' => [
    'consumers_wait_for_messages' => 1,
    'amqp' => [
        'host' => 'your-amqp-host',
        'port' => '5672',
        'user' => 'your-user-name',
        'password' => 'your-password',
        'virtualhost' => 'your-virutal-host-directory',
        'ssl' => 'true'
    ]],
    

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.