laravel-10laravel-queuelaravel-sail

Laravel | Laravel Queue Job Is Not Being Processed


I have dispatched a job and the the job is added to the database on the specified table, e.g. "Jobs. The jobs are not being processed, even though the jobs are added to the database. No log neither failed_job.

I have tried to create a new simple job with only Logger suspecting that I have errors in the handle code, still not working.


Solution

  • Here is what I did.

    1. Check the .env that the QUEUE_CONNECTION is the connection used storing the job.
    2. Check if the dispatched job is added to the correct connection and queue, in my case the connection should be "Database" and queue should be "default".
    3. Check if running the worker with queue:work has the connection specified (this is only relevant if the QUEUE_CONNECTION in the database is not the one used for the job; in my case such as: php artisan queue:work database --queue=default.