Skip to content
Magento 2 Message Queue Open Source Module
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Console add option run-once to ce_mq:consumers:start (#8) Oct 17, 2018
etc fix valid module name format according to Magento2 standard (#9) Dec 4, 2018
.coveralls.yml Configure Travis builds Oct 1, 2017
.gitignore Configure Travis builds Oct 1, 2017
.travis.yml Fix Travis build Dec 17, 2018
LICENSE.txt Initial commit Jun 8, 2017 Update dependencies for M2.3.x Dec 17, 2018
composer.json [VOSSCHEM-276] composer add support for php 7.3 Nov 22, 2019
registration.php Initial commit Jun 8, 2017

Magento 2 Message Queue Module

Lightweight implementation of message queue for Magento 2 Community Edition.

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads License

System requirements

This extension supports the following versions of Magento:

  • Community Edition (CE) versions 2.1.x
  • Community Edition (CE) versions 2.2.x
  • Community Edition (CE) versions 2.3.x


  1. Require the module via Composer
$ composer require renatocason/magento2-module-mq
  1. Enable the module
$ bin/magento module:enable Rcason_Mq
$ bin/magento setup:upgrade
  1. Install a message queue backend extension of your choice (see Message queue backends section)
  2. Configure your queue(s) and implement your consumer(s) (see Implementation section)
  3. Check the correct configuration of your queue(s)
$ bin/magento ce_mq:queues:list
  1. Run your consumer(s)
$ bin/magento ce_mq:consumers:start product.updates

Message queue backends

This module does not include any message queue backend implementation. You will have to chose and install one of the following modules (or implement your own) in order to get your message queues working:

  • MqMysql - Stores messages in the database
  • MqAmqp - Integrates any AMQP queue manager (i.e. RabbitMQ)
  • Amazon SQS - Integrates Amazon SQS as a queue manager (work in progress)


A simple example can be found here.

  1. Configure queue(s) in your module's etc/m2_mq.xml file
<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Rcason_Mq:etc/ce_mq.xsd">
    <ceQueue name="product.updates" broker="mysql"
  1. Require the publisher in the classes you need it
 * @param \Rcason\Mq\Api\PublisherInterface $publisher
public function __construct(
    \Rcason\Mq\Api\PublisherInterface $publisher
) {
    $this->publisher = $publisher;
  1. Use it to queue messages
$this->publisher->publish('product.updates', $productId);
  1. Implement your consumer(s)
class ExampleConsumer implements \Rcason\Mq\Api\ConsumerInterface
     * {@inheritdoc}
    public function process($productId)
        // Your code here

Authors, contributors and maintainers




Licensed under the Open Software License version 3.0

You can’t perform that action at this time.