Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 59f8ddf

Browse files
Merge pull request magento#1697 from magento/1662-move-message-queue
1662: Message queue troubleshooting
2 parents e2c5469 + b639f9e commit 59f8ddf

File tree

5 files changed

+56
-26
lines changed

5 files changed

+56
-26
lines changed

_data/toc/cloud-guide.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,3 +335,7 @@ pages:
335335

336336
- label: Theme troubleshooting
337337
url: cloud/trouble/theme-troubleshooting.html
338+
339+
- label: Message queues
340+
url: cloud/trouble/message-queues.html
341+
versions: ["2.2","2.3"]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<div markdown="1">
2+
3+
You must set the variable value using JSON. For example:
4+
5+
```json
6+
{
7+
"cron_run":"true",
8+
"max_messages":1000,
9+
"consumers":[
10+
"consumer1",
11+
"consumer2"
12+
]
13+
}
14+
```
15+
16+
- `cron_run`—A boolean value that enables or disables the `consumers_runner` cron job (default = `false`).
17+
- `max_messages`—A number specifiying the maximum number of messages each consumer must process before terminating (default = `1000`). Although we do not recommend it, you can use `0` to prevent the consumer from terminating.
18+
- `consumers`—An array of strings specifying which consumer(s) to run. An empty array runs _all_ consumers. Refer to [List consumers]({{page.baseurl}}config-guide/mq/manage-mysql.html#list-consumers) for more information.
19+
20+
To configure the `CRON_CONSUMERS_RUNNER` environment variable:
21+
22+
1. In a terminal, log in to your project.
23+
24+
magento-cloud login
25+
26+
1. Set the variable value. You must include the `--json` option and enclose the JSON with single quotes. For example:
27+
28+
magento-cloud project:variable:set --json CRON_CONSUMERS_RUNNER '{"cron_run":"true", "max_messages":1000, "consumers":["consumer1","consumer2"]}'

guides/v2.2/cloud/env/working-with-variables.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,4 @@ If you don’t want to implement the [RabbitMQ]({{page.baseurl}}cloud/project/pr
9191
Refer to [Manage message queues]({{page.baseurl}}config-guide/mq/manage-mysql.html) for more information about how this works in {{site.data.var.ce}} and {{site.data.var.ee}}.
9292
</div>
9393

94-
You must set the variable value using JSON. For example:
95-
96-
```json
97-
{
98-
"cron_run":"true",
99-
"max_messages":1000,
100-
"consumers":[
101-
"consumer1",
102-
"consumer2"
103-
]
104-
}
105-
```
106-
107-
- `cron_run`—A boolean value that enables or disables the `consumers_runner` cron job (default = `false`).
108-
- `max_messages`—A number specifiying the maximum number of messages each consumer must process before terminating (default = `1000`). Although we do not recommend it, you can use `0` to prevent the consumer from terminating.
109-
- `consumers`—An array of strings specifying which consumer(s) to run. An empty array runs _all_ consumers. Refer to [List consumers]({{page.baseurl}}config-guide/mq/manage-mysql.html#list-consumers) for more information.
110-
111-
To configure the `CRON_CONSUMERS_RUNNER` environment variable:
112-
113-
1. In a terminal, log in to your project.
114-
115-
magento-cloud login
116-
117-
1. Set the variable value. You must include the `--json` option and enclose the JSON with single quotes. For example:
118-
119-
magento-cloud project:variable:set --json CRON_CONSUMERS_RUNNER '{"cron_run":"true", "max_messages":1000, "consumers":["consumer1","consumer2"]}'
94+
{% include cloud/cron-consumers-runner.md %}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
layout: default
3+
group: cloud
4+
title: Message queues
5+
version: 2.0
6+
github_link: cloud/trouble/message-queues.md
7+
functional_areas:
8+
- Cloud
9+
- Configuration
10+
- Services
11+
---
12+
13+
If you use cron jobs—or some other external process manager—to manage message queues instead of [RabbitMQ]({{page.baseurl}}cloud/project/project-conf-files_services-rabbit.html), you may need to use an environment variable to restart message queue consumers after every deployment.
14+
15+
## Symptom
16+
Message queue consumers fail to restart after you deploy code to an environment.
17+
18+
## Solution
19+
<!-- Available for 2.2.x only. -->
20+
Use the `CRON_CONSUMERS_RUNNER` environment variable to ensure that consumers are retrieving messages from the message queue.
21+
22+
{% include cloud/cron-consumers-runner.md %}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../v2.2/cloud/trouble/message-queues.md

0 commit comments

Comments
 (0)