I'm using Magento 2.3.4 with RabbitMQ configured in the env.php
to process my message queues, I start consumer using:
bin/magento queue:consumers:start ConsumerName --max-messages 1
But the consumer keeps listening forever, never exits.
It seems to be a native issue in Magento, how could I solve it?
Best Answer
I had to force the setting to be 0 by adding the below to
env.php
:If you look at this file:
vendor/magento/framework-message-queue/CallbackInvoker.php
You will see that Magento 2 actually makes the default for this setting 1 (contrary to the documentation)
After doing that, my other cron processes started running again and I no longer saw the parent cron job as "stuck"
Full article here.
Reference here.