How can I process the message queue und execute my task? Which steps should I follow to set up the above command example as a cronjob? For the information I have created a scheduled task, that runs the task every 5 min and my task still executed just once time. The next execute timing will be not processed
bin/console scheduled-task:run
In short, here are three basic steps needed for a scheduled task:
Register: bin/console scheduled-task:register
Run: bin/console scheduled-task:run
Consume message: bin/console messenger:consume
Please look at the document here for more details.
About why your task is still executed just once, please check the status of the scheduled_task table (scheduled, running, failed, etc.). Usually, in the failed state, the schedule is discarded by default after three attempts.
Tip: Depending on your task logic, you can override the shouldRescheduleOnFailure method in the task class to allow it to continue running.