Skip to content

Commit

Permalink
NEXT-31249 - refer to low priority queue in add-essages-to-queue
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzKrafeld committed Oct 26, 2023
1 parent f80b463 commit 8be6d79
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 66 deletions.
4 changes: 2 additions & 2 deletions guides/hosting/infrastructure/message-queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav:
## Overview

::: warning
This guide contains the `async_low_priority` queue which is only available in version 6.5.7.0 and above. You must not configure this queue in older versions as the messenger:consume command will fail.
This guide contains the `async_low_priority` queue which is only available in version 6.5.7.0 and above. Configuring the messenger to consume this queue will fail, if it does not exist.
:::

Shopware uses the Symfony Messenger component and Enqueue to handle asynchronous messages. This allows tasks to be processed in the background. Thus, tasks can be processed independently of timeouts or system crashes. By default, tasks in Shopware are stored in the database and processed via the browser as long as you are logged into the Administration. This is a simple and fast method for the development process, but not recommended for production systems. With multiple users logged into the Administration, this can lead to a high CPU load and interfere with the smooth execution of PHP FPM.
Expand Down Expand Up @@ -121,7 +121,7 @@ Please refer to the [Symfony documentation](https://symfony.com/doc/current/mess
### Admin worker

::: warning
The `transports` option can only be configured with the `async_low_priority` transport if you are on version 6.5.7.0 or above. You must not the `async_low_priority` in lower versions as the admin worker will fail.
The `transports` option can only be configured with the `async_low_priority` transport if you are on version 6.5.7.0 or above. You must not add the `async_low_priority` transport in lower versions as the admin worker will fail when it tries to consume a non-existent transport.
:::

The admin worker, if used, can be configured in the general `shopware.yml` configuration. If you want to use the admin worker, you have to specify each transport that was previously configured. The poll interval is the time in seconds that the admin worker polls messages from the queue. After the poll interval is over, the request terminates, and the Administration initiates a new request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nav:
## Overview

::: warning
This guide contains the `async_low_priority` queue which is only available in version 6.5.7.0 and above. You must not configure this queue in older versions as the messenger:consume command will fail.
This guide contains the `async_low_priority` queue which is only available in version 6.5.7.0 and above. Configuring the messenger to consume this queue will fail, if it does not exist.
:::

In this guide you'll learn how to create a message handler.
Expand Down Expand Up @@ -176,7 +176,7 @@ You can route messages by their classname and use the asterisk as a fallback for
### Admin worker

::: warning
The `transports` option can only be configured with the `async_low_priority` transport if you are on version 6.5.7.0 or above. You must not the `async_low_priority` in lower versions as the admin worker will fail.
The `transports` option can only be configured with the `async_low_priority` transport if you are on version 6.5.7.0 or above. You must not add the `async_low_priority` transport in lower versions as the admin worker will fail when it tries to consume a non-existent transport.
:::

The admin-worker can be configured or disabled in the general `shopware.yml` configuration. If you want to use the admin worker you have to specify each transport, that previously was configured. The poll interval is the time in seconds that the admin-worker polls messages from the queue. After the poll-interval is over the request terminates and the Administration initiates a new request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ As most guides, this guide is also built upon the [Plugin base guide](../../plug

## Create a message

First, we have to create a new message class in the directory `<plugin root>/MessageQueue/Message`. In this example, we create a `SmsNotification` that contains a string with content. By default, all messages are handled synchronously, to change the behavior to asynchronously we have to implement the `AsyncMessageInterface` interface. For more information about asynchronous messages, have a look at our guide about [Handling asynchronous messages](handle-asynchronous-messages.md).
First, we have to create a new message class in the directory `<plugin root>/MessageQueue/Message`. In this example, we create a `SmsNotification` that contains a string with content. By default, all messages are handled synchronously, to change the behavior to asynchronously we have to implement the `AsyncMessageInterface` interface. For messages which should also be handled asynchronously but with a lower priority, we have to implement the `AsyncLowPriorityMessageInterface` interface.

Here's an example:

Expand Down

This file was deleted.

0 comments on commit 8be6d79

Please sign in to comment.