I have a MySQL-based queue that has been added by a custom extension and I'd like to know how to configure the CRON to run that queue process.
The Magento documentation has this to say about how to run a Magento 2 Queue using a CRON job:
After consuming all available messages, the command terminates. You can run the command again manually or with a cron job. … For example, you can append & to the command to run it in the background, return to a prompt, and continue running commands (e.g.,
bin/magento queue:consumers:start <consumer_name> &
).
Based on the documentation, I would think you'd configure a CRON job like this:
* * * * * /var/www/stage/current/bin/magento queue:consumers:start <NAME OF QUEUE> &
However if I run just /var/www/stage/current/bin/magento queue:consumers:start <NAME OF QUEUE> &
on the command line, the process runs for a long time (potentially indefinitely?), so I can't see how running that command every minute from the CRON job would work, as you'd have an ever-increasing number of processes running.
What is the recommended way to run a MySQL queue from the command line?