How to Configure Magestore POS using RabbitMQ on Magento

Prerequisites

1. RabbitMQ is installed and connected to Magento.

The image below shows that RabbitMQ is connected with Magento, if the queue “async.operations.all” does not display as the image, that means RabbitMQ cannot connect to Magento, please follow the instructions to install RabbitMQ from Magento to configure it.

2. Magestore POS supports message queue

  • POS Enterprise Commerce >=v4.8.0

  • POS Enterprise >=v4.13.8

  • POS Pro Commerce >=v4.5.0

  • POS Pro >=v4.15.0

Read more: How to check your POS version from the backend, to know which version of Magestore POS you are using.

3. Magento Cron is configured and running

Configure

1. Configure the env . file

  1. Open file app/etc/env.php

  2. Find the key ‘cron_consumers_runner’ in the file

  • If there is no key ‘cron_consumers_runner’ in the file, add the below config, place to the same level as the key ‘queue’

'cron_consumers_runner' => [ 'cron_run' => true, 'max_messages' => 0, 'consumers' => [] ],
  • If the file already has the key ‘cron_consumers_runner’, and the array ‘consumers’ already has the value, then it needs  magestore_pos_process_order.convert.consumerto be appended to the end of the array.

Note: If there is no key ‘consumers’ or there is but an empty array, then no need to modify anything because by default all consumers are allowed.

'cron_consumers_runner' => [ 'cron_run' => true, 'max_messages' => 0, 'consumers' => [ 'async.operations.all', 'codegeneratorProcessor', 'product_action_attribute.update', 'product_action_attribute.website.update', 'exportProcessor', 'magestore_pos_process_order.convert.consumer' ] ],
  1. Find the key ‘queue’ > ‘consumers_wait_for_messages’ in the file, switch back to 

0, if not, add as below

'queue' => [ 'consumers_wait_for_messages' => 0, ],
  1. Save the file

After editing it will look like the image below 

Notes: See more suggestions from Magento

2. Edit message queue configuration in Webpos module

1. File: app/code/Magestore/Webpos/etc/queue.xml
  • Tag “broker”

    • Attribute “exchange” change from “magento-db” to “magento”

    • Attribute “type” change from “db” to “amqp”

File content after being changed