2017 © Pedro Peláez
 

magento2-module magento2-module-mq

Magento 2 Message Queue OS Module

image

renatocason/magento2-module-mq

Magento 2 Message Queue OS Module

  • Tuesday, July 3, 2018
  • by renatocason
  • Repository
  • 3 Watchers
  • 16 Stars
  • 426 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 10 Forks
  • 2 Open issues
  • 5 Versions
  • 66 % Grown

The README.md

Magento 2 Message Queue Module

Lightweight implementation of message queue for Magento 2 Community Edition., (*1)

Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads License, (*2)

System requirements

This extension supports the following versions of Magento:, (*3)

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

Installation

  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), (*4)

Implementation

A simple example can be found here., (*5)

  1. Configure queue(s) in your module's etc/m2_mq.xml file
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Rcason_Mq:etc/ce_mq.xsd">
    <ceQueue name="product.updates" broker="mysql"
        messageSchema="int"
        consumerInterface="Rcason\MqExample\Model\ExampleConsumer"/>
</config>
  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

Author: - Renato Cason, (*6)

Contributions: - grafikchaos - jonathan-martz - antoninobonumore - For a full list of contributors visit Magento 2 Message Queue Module on GitHub, (*7)

License

Licensed under the Open Software License version 3.0, (*8)

The Versions

03/07 2018

dev-master

9999999-dev

Magento 2 Message Queue OS Module

  Sources   Download

OSL-3.0

The Requires

 

The Development Requires

03/07 2018

1.0.0

1.0.0.0

Magento 2 Message Queue OS Module

  Sources   Download

OSL-3.0

The Requires

 

The Development Requires

03/12 2017

0.1.2

0.1.2.0

Magento 2 Message Queue OS Module

  Sources   Download

OSL-3.0

The Requires

 

The Development Requires

06/10 2017

0.1.1

0.1.1.0

Magento 2 Message Queue OS Module

  Sources   Download

OSL-3.0

The Requires

 

The Development Requires

08/06 2017

0.1.0

0.1.0.0

Magento 2 Message Queue OS Module

  Sources   Download

OSL-3.0

The Requires

  • php ~5.6.5|~7.0.0
  • magento/framework 100.1.*
  • magento/module-store 100.1.*