Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit a6e5abd

Browse files
Added docs for consumers_wait_for_messages option (#8010)
1 parent 3f1e2e0 commit a6e5abd

File tree

2 files changed

+41
-17
lines changed

2 files changed

+41
-17
lines changed

src/guides/v2.3/config-guide/mq/manage-message-queues.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ Edit the `/app/etc/env.php` file to configure the cron job `consumers_runner`.
5959
```
6060

6161
* `cron_run` - A boolean value that enables or disables the `consumers_runner` cron job (default = `true`).
62-
* `max_messages` - The maximum number of messages each consumer must process before terminating (default = `10000`). Although we do not recommend it, you can use 0 to prevent the consumer from terminating.
62+
* `max_messages` - The maximum number of messages each consumer must process before terminating (default = `10000`). Although we do not recommend it, you can use 0 to prevent the consumer from terminating. See [`consumers_wait_for_messages`]({{ page.baseurl }}/config-guide/prod/config-reference-envphp.html#consumers_wait_for_messages) to configure how consumers process messages from the message queue.
6363
* `consumers` - An array of strings specifying which consumer(s) to run. An empty array runs *all* consumers.
6464

65+
{:.bs-callout-info}
66+
If your {{ site.data.var.ee }} store is hosted on the Cloud platform, use the [`CONSUMERS_WAIT_FOR_MAX_MESSAGES`]({{ site.baseurl }}/cloud/env/variables-deploy.html#consumers_wait_for_max_messages) to configure how consumers process messages from the message queue.
67+
6568
{% include config/message-queue-consumers.md %}
6669

6770
#### Related Topics

src/guides/v2.3/config-guide/prod/config-reference-envphp.md

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@ functional_areas:
99

1010
The `env.php` file contains the following sections:
1111

12-
| Name | Description |
13-
| --------------------- | ---------------------------------------------- |
14-
| `backend` | Settings for the Admin area |
15-
| `cache_types` | Cache storage settings |
16-
| `cron` | Enable or disable the cron jobs |
17-
| `crypt` | The encryption key for cryptographic functions |
18-
| `db` | Database connection settings |
19-
| `directories` | Magento directories mapping settings |
20-
| `downloadable_domains`| List of downloadable domains |
21-
| `install` | The installation date |
22-
| `lock` | Lock provider settings |
23-
| `MAGE_MODE` | The [Magento mode][magento-mode] |
24-
| `queue` | [Message queues][message-queues] settings |
25-
| `resource` | Mapping of resource name to a connection |
26-
| `session` | Session storage data |
27-
| `x-frame-options` | Setting for [x-frame-options][x-frame-options] |
12+
| Name | Description |
13+
|-------------------------------|-----------------------------------------------------------------|
14+
| `backend` | Settings for the Admin area |
15+
| `cache_types` | Cache storage settings |
16+
| `consumers_wait_for_messages` | Configure how consumers process messages from the message queue |
17+
| `cron` | Enable or disable the cron jobs |
18+
| `crypt` | The encryption key for cryptographic functions |
19+
| `db` | Database connection settings |
20+
| `directories` | Magento directories mapping settings |
21+
| `downloadable_domains` | List of downloadable domains |
22+
| `install` | The installation date |
23+
| `lock` | Lock provider settings |
24+
| `MAGE_MODE` | The [Magento mode][magento-mode] |
25+
| `queue` | [Message queues][message-queues] settings |
26+
| `resource` | Mapping of resource name to a connection |
27+
| `session` | Session storage data |
28+
| `x-frame-options` | Setting for [x-frame-options][x-frame-options] |
2829

2930
## backend
3031

@@ -62,6 +63,26 @@ All the Magento cache types configuration are available from this node.
6263

6364
Learn more about different [Cache Types][cache-types].
6465

66+
## consumers_wait_for_messages
67+
68+
Specify whether consumers should continue polling for messages if the number of processed messages is less than the `max_messages` value. The default value is `1`.
69+
70+
```conf
71+
'queue' => [
72+
'consumers_wait_for_messages' => 1
73+
]
74+
```
75+
76+
The following options are available:
77+
78+
- `1`—Consumers continue to process messages from the message queue until reaching the `max_messages` value specified in the `env.php` file before closing the TCP connection and terminating the consumer process. If the queue empties before reaching the `max_messages` value, the consumer waits for more messages to arrive.
79+
80+
We recommend this setting for large merchants because a constant message flow is expected and delays in processing are undesirable.
81+
82+
- `0`—Consumers process available messages in the queue, close the TCP connection, and terminate. Consumers do not wait for additional messages to enter the queue, even if the number of processed messages is less than the `max_messages` value specified in the `env.php` file. This can help prevent issues with cron jobs caused by long delays in message queue processing.
83+
84+
We recommend this setting for smaller merchants that do not expect a constant message flow and prefer to conserve computing resources in exchange for minor processing delays when there could be no messages for days.
85+
6586
## cron
6687

6788
Enable or disable cron jobs for the Magento application. By default, cron jobs are enabled. To disable them, add the `cron` configuration to the `env.php` file and set the value to `0`.

0 commit comments

Comments
 (0)