< Back
Print

Magento RabbitMQ Connection

Transfer data to Magento using RabbitMQ

The export of product and category data to Magento via RabbitMQ has the advantage that the Magento server can handle the fetching of the data itself. This means that when it is under heavy load, it is not additionally burdened with product updates. The configuration is very simple.

1) [Optional] Add a user in the OWL

If you want to use the OWL as a RabbitMQ server, then create a new user.

2) Connect to Magento site with a Rabbit MQ

As described in the instructions (https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/prerequisites/rabbitmq.html?lang=en#connect-rabbitmq), you must configure the connection data to RabbitMQ. Attention create a separate vhost setting for TEST and PROD system.

With the SAWS data hub we offer our own RabbitMQ server, which can be used to transfer the data. Of course you can also install your own server, but keep in mind that it must be accessible from the CS PIM system.

vi <<MagentoPath>>/app/etc/env.php

Configure the connection parameters.

'queue' => [
  'amqp' => [
    'host' => 'owl.saws.de',
    'port' => '5672',
    'user' => 'magento-test@<<License-key>>.owl',
    'password' => '<<my-password>>',
    'virtualhost' => 'owl/<<License-key>>'
  ]
],

After the running the command or updating the <<MagentoPath>>/app/etc/env.php file with AMQP configuration values, run bin/magento setup:upgrade to apply the changes and create the required queues and exchanges in RabbitMQ.

bin/magento setup:upgrade

3) Start the consumer on Magento side

In order for the messages to be fetched, a consumer must be started on Magento side. This is described in the manual: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cli/start-message-queues.html?lang=en
If necessary, an entry can also be made in the crontab of the www-data user, which starts the consumer if necessary.

crontab -e -u www-data


* * * * * /usr/bin/php7.4 /var/www/magento/current/bin/magento queue:consumer:start sawsimportConsumer --single-thread --max-messages 100 > /var/www/magento/current/var/log/sawsimportConsumer.cron.log

2) Configure the Magento Station on CS page

Under the Target System settings you can set the RabbitMQ settings and then enable the transfer via RabbitMQ.

Was this article helpful?
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents