How the message queues schedule works?
-
13-04-2021 - |
Question
I just configured my message queues to run via RabbitMQ, but I don't know the schedule and frequency of these processes.
How could I check the schedule and change the number of processes to be executed?
La solution
The default schedule is every minute, as you can see in this core file below.
<!-- /app/code/Magento/MessageQueue/etc/crontab.xml -->
<job name="consumers_runner" instance="Magento\MessageQueue\Model\Cron\ConsumersRunner" method="run">
<schedule>* * * * *</schedule>
</job>
- Re-running cron restarts the consumer.
- Each consumer processes 10000 messages and then terminates
To view a list of all consumers you can run:
bin/magento queue:consumers:list
You can edit your env.php
to change the Consumers' runners and the amount to be executed.
'cron_consumers_runner' => array(
'cron_run' => false,
'max_messages' => 20000,
'consumers' => array(
'consumer1',
'consumer2',
)
),
Reference: DevDocs - Manage Message Queues
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange