diff --git a/defaults/main.yml b/defaults/main.yml index 0a770b5..c30c169 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -296,6 +296,10 @@ magento_upgrade_commands: ## See https://magento.stackexchange.com/questions/285385/magento-2-3-2-ce-and-cron-jobs-flock-and-rabbitmq/285386#285386 magento_run_message_queue_consumers_separately: false +## in case you don't want message queue consumers to wait for messages - change this to false +## Changing it to false reduces server memory consuption but increases the waiting time for messages to be processed. +magento_queue_consumers_wait_for_messages: true + magento_queue_consumers_cron_template: "/usr/bin/php {{ magento_app_root }}/bin/magento queue:consumers:start {{ item.name }}" ## Deletes all installed deployable magento packages except the diff --git a/templates/etc/env.php.j2 b/templates/etc/env.php.j2 index 6a56aef..c2caa4d 100644 --- a/templates/etc/env.php.j2 +++ b/templates/etc/env.php.j2 @@ -119,9 +119,10 @@ return array ( array ( 'date' => '{{ magento_install_date }}', ), - {% if magento_queue_amqp is defined %} 'queue' => array ( + 'consumers_wait_for_messages' => {{ magento_queue_consumers_wait_for_messages }}, + {% if magento_queue_amqp is defined %} 'amqp' => array ( 'host' => '{{ magento_queue_amqp.host }}', @@ -131,8 +132,8 @@ return array ( 'virtualhost' => '{{ magento_queue_amqp.virtualhost }}', 'ssl' => '{{ magento_queue_amqp.ssl }}', ), + {% endif %} ), - {% endif %} {% if magento_run_message_queue_consumers_separately %} 'cron_consumers_runner' => array( 'cron_run' => false