RabbitMQ for more stable Shopware shops
The reliable functionality of an online shop is indispensable for webshop operators. Especially the correct execution of cronjobs and scheduled tasks is essential to ensure smooth operation.
Our partner Proxation GmbH explains in this guest article how the open source software RabbitMQ can provide more stability in the operation of Shopware shops.
Problematic execution of scheduled tasks in Shopware 6
In online shops, many processes are executed by cronjobs, or "scheduled tasks" as they are called in Shopware 6. This includes, for example, the generation of data exports, but also many plugins or apps use scheduled tasks to fulfil their tasks. At Proxation, we repeatedly encountered the problem that the Message Queue was full or was not executed further, especially in larger shops. This results in the problem that essential processes are not executed.
Smooth execution of PHP FPM?!
Shopware uses the Messenger component of the PHP frameworks Symfony and Enqueue to process asynchronous messages. This allows tasks to be processed in the background. Tasks can thus 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 the user is logged into the administration.
While this is a simple and quick method for the development process, it is not recommended for production systems. In addition, if multiple users are logged into the administration, this can lead to a high CPU load and affect the smooth execution of PHP FPM.
RabbitMQ for reliable execution of scheduled tasks
For the reliable execution of scheduled tasks, the use of RabbitMQ has proven itself with Proxation.
What is RabbitMQ?
RabbitMQ is an open source middleware platform (i.e. free to use) that is used as a message broker and can be used in various applications.
What are the advantages of RabbitMQ?
RabbitMQ has several advantages - here are some of them:
- Reliable transmission of "Scheduled Tasks ": RabbitMQ provides reliable message delivery, ensuring that messages are not lost even when network outages occur. This is guaranteed through the use of message queues and acknowledgements.
- Integration: With maxcluster, RabbitMQ is configurable via the web interface.
- Message queues: RabbitMQ enables the use of queues to buffer messages between producers and consumers. This facilitates the decoupling of different parts of an application and provides better scalability.
- Flexibility and extensibility: RabbitMQ is extremely flexible and can be extended through plugins. This makes it possible to adapt RabbitMQ to the specific requirements of the application used.
- Routing: RabbitMQ provides powerful routing mechanisms that allow messages to be targeted to specific recipients or groups of recipients. This is particularly useful in scenarios where messages need to be routed to different processing steps or application components.
- Scalability: RabbitMQ can be easily scaled by adding additional nodes to handle the load. This allows large volumes of messages to be processed efficiently.
- Management and Monitoring: RabbitMQ provides a web-based user interface and tools for monitoring and managing queues and messages. This makes it easier for shop developers in particular to manage and debug RabbitMQ instances.
Configuration of RabbitMQ at maxcluster
RabbitMQ can already be found in the menu of the maxcluster Managed Center as a subitem of "Cache & Queue".
The installation is straightforward. However, if you need assistance, please contact maxcluster support by email at service@maxcluster.de or by phone at +49 5251 4141 30.
Basically, the initial installation is to be carried out via this. However, in order to set up RabbitMQ fully functionally for your Shopware shop, further configurations are necessary in the RabbitMQ installation as well as in the respective Shopware 6 installation. Our experts at Proxation are available for this - for the direct configuration as well as integration of RabbitMQ, but also with a training for developers and agencies.
Conclusion
Even Shopware refers to the use of a service such as RabbitMQ to ensure correct or reliable functioning. Due to the simple configuration option on the part of maxcluster, there is still nothing to be said against its use. A quick win for the entire shop project.
Published on 25.09.2023 | Proxation | NM
You have questions, requests, criticism, suggestions or just want to tell us your opinion about our blog? Here you have the opportunity to contact us directly.
Send e-mail