Magento 2 EE – Add RabbitMQ to Existing Installation

magento-enterprisemagento2message-queuerabbit-mq

Is there a way to add RabbitMQ/AMQP setup to an existing M2 EE installation? All the docs seem to shout that it has to be done at install time but that seems a bit limiting. However, I can't find anywhere in the admin to configure host, port etc.

Best Answer

The following steps should help:

  1. Add the following element to array in app/etc/env.php:

    'queue' => [ 'amqp' => [ 'host' => 'localhost', 'port' => '5672', 'user' => 'guest', 'password' => 'guest', 'virtualhost' => '/', 'ssl' => '' ] ]

  2. Make sure exchanges, queues and exchange-to-queue mappings are configured properly on RabbitMQ side. At the moment this is done only once when AMQP module is installed. However, it is possible to initiate RabbitMQ configuration process by calling \Magento\Amqp\Model\Topology::install. RabbitMQ management plugin is a good tool to view current configuration

At the moment RabbitMQ support is implemented on very basic level and is going to be improved in scope of the nearest Magento releases. The best option for now is to reinstall Magento if possible.

Related Topic