Homepage
Main navigation
Main content
Additional information
Login / Sign up
Quality Guidelines
Propose new content
Shopware resources and help articles
Simple and to the point. Optimized by the community.
×
Login / Sign up
Quality Guidelines
Propose new content
Edit trick
Changes will be published after manual review
Title
Give your trick a describing title. Do
not
start with «How to...».
Your trick
Keep it short and concise! Markdown is supported.
By default Shopware uses the database to handle messages added to and processed from queues. This is slow and puts unnecessary strain onto the database. Follow these steps to replace the database queue with the RabbitMQ system. **Dependencies** ``` composer require enqueue/amqp-ext ``` **Config Setup** Add custom enqueue handler. Create a config/packages/enqueue.yaml file: ``` enqueue: amqp: transport: '%env(AMQP_URL)%' client: ~ ``` Register your transport. Add this to your config/packages/framework.yaml file: ``` framework: messenger: transports: default: enqueue://amqp ``` In your .env file add the following line: AMQP_URL="amqp://guest:guest@rabbitmq:5672/%2f?connect_timeout=30&heartbeat=0" Remember to change the login credentials and host name. Now you're ready to use RabbitMQ as your message queue handler. **Production Queue Create Bug** There is a bug where the initial queue is only created in debug mode, not production mode. Fix it with this: ``` nano +123 vendor/sroze/messenger-enqueue-transport/QueueInteropTransport.php # Remove if part. Line 123 and line 125 # Clear OPCache as well php bin/console cache:clear # Now you need to force adding jobs to the queue. # fx: php bin/console dal:refresh:index --use-queue -vvv ``` Or use this patch: ``` Ensure that RabbitMQ queues are also created in PROD mode. @package sroze/messenger-enqueue-transport --- QueueInteropTransport.php +++ QueueInteropTransport.php @@ -120,9 +120,7 @@ $destination = $this->getDestination($envelope); $topic = $context->createTopic($destination['topic']); - if ($this->debug) { - $this->contextManager->ensureExists($destination); - } + $this->contextManager->ensureExists($destination); $interopMessage = $this->encodeMessage($envelope); ```
References
Add additional online resources to your trick
×
Name
URL
×
Name
URL
×
Name
URL
+ Add reference
Topics
If your trick fits more than one topic select multiple. Select at least one.
Backend
Frontend
Administration
Performance
Indexing
SEO
Database
Tags
You can use existing tags or create new ones. Add at least one.
Submit for review
Cancel
We use cookies to measure the performance of this website. Do you want to accept these cookies?
Accept
Decline