Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions guides/v2.2/config-guide/mq/manage-message-queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ functional_areas:
- Setup
---

If you don't want to implement the RabbitMQ solution, you can manage message queues with cron jobs (or an external process manager) and the command line to ensure that consumers are retrieving messages.
You can manage message queues from the command line using cron jobs or an external process manager to ensure that consumers are retrieving messages.

## Process management

Cron jobs are the default mechanism to restart consumers. Processes started by `cron` consume the specified number of messages and then terminate. Re-running `cron` restarts the consumer.

The following shows a `crontab` configuration for running consumers in our implementation, it is the example for understanding how it works:
The following example shows the Magento `crontab` configuration for running consumers:

*/app/code/Magento/MessageQueue/etc/crontab.xml*
> /app/code/Magento/MessageQueue/etc/crontab.xml

```xml
...
Expand All @@ -40,6 +40,9 @@ You can also use a process manager such as [Supervisor](http://supervisord.org/i
* Cron job `consumers_runner` runs all defined consumers
* Each consumer processes 10000 messages and then terminates

{:.bs-callout-info}
If your {{ site.data.var.ee }} store is hosted on the Cloud platform, use the [`CRON_CONSUMERS_RUNNER`]({{ page.baseurl }}/cloud/env/variables-deploy.html#cron_consumers_runner) deploy variable to configure the `consumers_runner` cron job.

#### Specific configuration

Edit */app/etc/env.php* file for configure cron job `consumers_runner`
Expand All @@ -63,7 +66,7 @@ Edit */app/etc/env.php* file for configure cron job `consumers_runner`

## Command line interface

### Start consumers
### Start message queue consumers

Use the `magento` command to start message queue consumers. You can start multiple consumers simultaneously.

Expand Down
6 changes: 3 additions & 3 deletions guides/v2.2/install-gde/prereq/install-rabbitmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The message queue system must be established before you install Magento. The bas
1. Install RabbitMQ and any prerequisites.
1. Connect RabbitMQ and Magento.

{:.bs-callout .bs-callout-info}
A basic message queue system can be implemented on {{site.data.var.ee}} using cron instead of RabbitMQ. See [Configure message queues]({{ page.baseurl }}/config-guide/mq/manage-mysql.html) for more information.
{:.bs-callout-info}
You can use MySQL or RabbitMQ for message queue processing. For details on setting up the message queue system, see [Message queues overview]({{ page.baseurl }}/extension-dev-guide/message-queues/message-queues.html). If you are using the Bulk API with {{ site.data.var.ee }}, the message queue system configuration defaults to using RabbitMQ as the message broker. See [Start message queue consumers]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for more information.

## Install RabbitMQ on Ubuntu {#ubuntu-install}

Expand Down Expand Up @@ -133,7 +133,7 @@ To configure support for SSL, edit the `ssl` and `ssl_options` parameters in the

## Start the message queue consumers

After you have connected {{site.data.var.ee}} and RabbitMQ, you must start the message queue consumers. See [Configure message queues]({{ page.baseurl }}/config-guide/mq/manage-mysql.html) for details.
After you have connected {{site.data.var.ee}} and RabbitMQ, you must start the message queue consumers. See [Configure message queues]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for details.

{:.ref-header}
Related topics
Expand Down
4 changes: 2 additions & 2 deletions guides/v2.2/rest/bulk-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ functional_areas:

Bulk API endpoints differ from other REST endpoints in that they combine multiple calls of the same type into an array and execute them as a single request. The endpoint handler splits the array into individual entities and writes them as separate messages to the message queue.

{:.bs-callout .bs-callout-tip}
Use the `bin/magento queue:consumers:start async.operations.all` command to enable bulk endpoint processing.
{:.bs-callout-info}
Use the `bin/magento queue:consumers:start async.operations.all` command to start the consumer that handles asynchronous and bulk API messages. Also, before using the Bulk API to process messages, you must install and configure RabbitMQ, which is the default message broker. See [RabbitMQ]({{ page.baseurl }}/install-gde/prereq/install-rabbitmq.html).

### Routes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ This **5-step tutorial** generally takes **45 minutes**.

* Install a REST client. You can use any REST client to send calls to Magento. [Postman](https://www.getpostman.com/) is recommended.

* [Install and configure RabbitMQ]({{ page.baseurl }}/install-gde/prereq/install-rabbitmq.html), which is the default message broker for bulk API endpoints.

* Obtain an admin authorization token. All calls in this tutorial require administrator privileges. See [Generate the admin token]({{ page.baseurl }}/rest/tutorials/prerequisite-tasks/create-admin-token.html) for more information.

### Other resources
Expand Down
13 changes: 8 additions & 5 deletions guides/v2.3/config-guide/mq/manage-message-queues.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ functional_areas:
- Setup
---

If you don't want to implement the RabbitMQ solution, you can manage message queues with cron jobs (or an external process manager) and the command line to ensure that consumers are retrieving messages.
You can manage message queues from the command line using cron jobs or an external process manager to ensure that consumers are retrieving messages.

## Process management

Cron jobs are the default mechanism to restart consumers. Processes started by `cron` consume the specified number of messages and then terminate. Re-running `cron` restarts the consumer.

The following shows a `crontab` configuration for running consumers in our implementation, it is the example for understanding how it works:
The following example shows the Magento `crontab` configuration for running consumers:

*/app/code/Magento/MessageQueue/etc/crontab.xml*
> /app/code/Magento/MessageQueue/etc/crontab.xml

```xml
...
Expand All @@ -27,7 +27,7 @@ The following shows a `crontab` configuration for running consumers in our imple
...
```

{:.bs-callout .bs-callout-info}
{:.bs-callout-info}
How often you check message queues depends on your business logic and available system resources. In general, you'll probably want to check for newly created customers and send welcome emails more frequently than a more resource intensive process (e.g., updating your catalog). You should define `cron` schedules according to your business needs.<br><br>It can be configured in Admin Panel **Stores > Settings > Configuration > Advanced > System > Cron configuration options for group: consumers**<br><br>See [Configure and run cron]({{ page.baseurl }}/config-guide/cli/config-cli-subcommands-cron.html) for more information about using `cron` with Magento.

You can also use a process manager such as [Supervisor](http://supervisord.org/index.html) to monitor the status of processes. The manager can use the command line to restart the processes as needed.
Expand All @@ -40,9 +40,12 @@ You can also use a process manager such as [Supervisor](http://supervisord.org/i
* Cron job `consumers_runner` runs all defined consumers
* Each consumer processes 10000 messages and then terminates

{:.bs-callout-info}
If your {{ site.data.var.ee }} store is hosted on the Cloud platform, use the [`CRON_CONSUMERS_RUNNER`]({{ page.baseurl }}/cloud/env/variables-deploy.html#cron_consumers_runner) to configure the `consumers_runner` cron job.

#### Specific configuration

Edit */app/etc/env.php* file for configure cron job `consumers_runner`
Edit the `/app/etc/env.php` file to configure the cron job `consumers_runner`.

```php
...
Expand Down
17 changes: 9 additions & 8 deletions guides/v2.3/install-gde/prereq/install-rabbitmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The message queue system must be established before you install Magento. The bas
1. Connect RabbitMQ and Magento.

{:.bs-callout .bs-callout-info"}
A basic message queue system can be implemented using cron instead of RabbitMQ. See [Configure message queues]({{page.baseurl}}/config-guide/mq/manage-mysql.html) for more information.
You can use MySQL or RabbitMQ for message queue processing. For details on setting up the message queue system, see [Message queues overview]({{ page.baseurl }}/extension-dev-guide/message-queues/message-queues.html). If you are using the Bulk API with {{ site.data.var.ee }}, the message queue system configuration defaults to using RabbitMQ as the message broker. See [Start message queue consumers]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for more information.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can use MySQL or RabbitMQ for message queue processing. For details on setting up the message queue system, see [Message queues overview]({{ page.baseurl }}/extension-dev-guide/message-queues/message-queues.html). If you are using the Bulk API with {{ site.data.var.ee }}, the message queue system configuration defaults to using RabbitMQ as the message broker. See [Start message queue consumers]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for more information.
You can use MySQL or RabbitMQ for message queue processing. For details on setting up the message queue system, see [Message queues overview]({{ page.baseurl }}/extension-dev-guide/message-queues/message-queues.html). If you are using the Bulk API with {{ site.data.var.ee }}, the message queue system configuration defaults to using RabbitMQ as the message broker. See [Start message queue consumers]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for more information.


## Install RabbitMQ on Ubuntu {#ubuntu-install}

Expand Down Expand Up @@ -63,15 +63,16 @@ rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
The RabbitMQ server is included on CentOS, but the version is often old. RabbitMQ recommends installing the package from their website.

1. Download [rabbitmq-server-3.5.6-1.noarch.rpm](https://www.rabbitmq.com/releases/rabbitmq-server/v3.5.6/rabbitmq-server-3.5.6-1.noarch.rpm){:target="_blank"}.

1. Run the following commands as a user with root permissions:

```bash
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
```
```bash
rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
```

```bash
yum install rabbitmq-server-3.5.6-1.noarch.rpm
```
```bash
yum install rabbitmq-server-3.5.6-1.noarch.rpm
```

Refer to [Installing on RPM-based Linux](https://www.rabbitmq.com/install-rpm.html){:target="_blank"} for more information.

Expand Down Expand Up @@ -148,7 +149,7 @@ To configure support for SSL, edit the `ssl` and `ssl_options` parameters in the

## Start the message queue consumers

After you have connected Magento and RabbitMQ, you must start the message queue consumers. See [Configure message queues]({{page.baseurl}}/config-guide/mq/manage-mysql.html) for details.
After you have connected {{site.data.var.ee}} and RabbitMQ, you must start the message queue consumers. See [Configure message queues]({{page.baseurl}}/config-guide/mq/manage-message-queues.html#start-message-queue-consumers) for details.

{:.ref-header}
Related topics
Expand Down
4 changes: 2 additions & 2 deletions guides/v2.3/rest/bulk-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ functional_areas:

Bulk API endpoints differ from other REST endpoints in that they combine multiple calls of the same type into an array and execute them as a single request. The endpoint handler splits the array into individual entities and writes them as separate messages to the message queue.

{:.bs-callout .bs-callout-tip}
Use the `bin/magento queue:consumers:start async.operations.all` command to enable bulk endpoint processing.
{:.bs-callout-info}
Use the [`bin/magento queue:consumers:start async.operations.all`]({{ page.baseurl }}/config-guide/cli/config-cli-subcommands-queue.html) command to start the consumer that handles asynchronous and bulk API messages. Also, before using the Bulk API to process messages, you must install and configure RabbitMQ, which is the default message broker. See [RabbitMQ]({{ page.baseurl }}/install-gde/prereq/install-rabbitmq.html).

### Routes

Expand Down