Setup a local RabbitMQ instance

RabbitMQ Instance


This document describes what is needed to run RabbitMQ along side your sales channel to enable communication with Magento Order Management. OMS supports both JSON RPC and also AMQP message protocol to communicate with integrated systems.

  • Robust messaging for applications
  • Easy to use
  • Runs on all major operating systems
  • Support a huge number of developer platforms
  • Open source and commercially supported

RabbitMQ project homepage

Magento OMS Requirements

  • RabbitMQ version >= 3.6.x
  • RabbitMQ management plugin
  • Publicly accessible domain with signed SSL certificate

Setup Recommandations

  • High Availability RabbitMQ offers different high availability options like Clustering, Federation or Shovel . All three options work with the Magento OMS; the ideal choice depends on the infrastructure setup. If more than one datacenter is deployed, Federation or Shovel are the way to go otherwise a Clustering setup with an odd number of RabbitMQ servers is sufficient.
  • User management We recommend creating one user per application for every vhost. This facilitates debugging as connections can be identified more easily.
  • Certificates The message will be transported over a public network. SSL certificates have to be installed to ensure all content is encrypted.
  • Management Plugin Management plugins have full visibility to all messages. For security reasons, it should not be accessible publicly and be disabled on production systems.

In case of clustering setup:

  • Exchange/Queues policies Virtual host policies have to be applied to make sure queues and exchanges replicate across all nodes.

Allow connection from OMS to RabbitMQ

OMS will pull messages from your local RabbitMQ instance. You, therefore, need to create a local OMS user account with the below permissions and communicate these connection credentials to us.

  • Read
  • Write
  • Configuration changes

You may also need to consider if you need to whitelist our IP in your firewall to allow us to connect to your RabbitMQ instance. We can help you determine the necessary IP to whitelist during implementation.

Additional documentation

Message consumer setup

Magento Commerce (MC)

The MC message consumers have to be running continuously. The processes being PHP can not fork into child threads. This creates the risk that the processes can hit the PHP memory limit after running for a long period.


To avoid this problem, we recommend running the consumers using a tool such as supervisor with the following parameters:

  • Limit the processes’ lifetime by using the parameter --max-message=100
  • Always run two processes at once of every consumer using auto restart

Commands to run by supervisor

$ bin/magento queue:consumers:start stockConsumer --max-messages 100
$ bin/magento queue:consumers:start productReturnUpdatedConsumer --max-messages 100
$ bin/magento queue:consumers:start refundUpdatedConsumer --max-messages 100
$ bin/magento queue:consumers:start orderUpdatedConsumer --max-messages 100
$ bin/magento queue:consumers:start shipmentShippedConsumer --max-messages 100


The MC extension and the MCOM connector will both create their corresponding inbox. To allow the messages to flow between the inboxes we need to create a binding from inbox to inbox.MC. This has to be done in the management plugin:

RabbitMQ bindings

Two bindings need to be created:

  • to:mdc
  • to:*

Manual Actions

After the first execution $ bin/magento setup:install some bindings are set incorrectly. These need to be deleted manually, to do that you need to go to the Exchange tab and select Outbox Exchange.

Now you should see the following setup

Wrong Setup:

Alt Text

Next, you need to unbind the following queues by pressing the corresponding “Unbind” button:

  • order-cancellation
  • order-consumer
  • order.get_notifications
  • order.resend_notification
  • product-consumer

Correct Setup:

Alt Text