Reputation: 703
In my local server I can use the queue without problem, just using:
php artisan queue:work
.
But in my server in AWS the queue don't running.
My connection queue is database
and sync mails are sending without problem.
I'd checked in Job table and I can see my queues but for unknown reason it's never running.
Is necessary to do some different configuration in AWS Elastic Beanstalke server?
I've tried to use manually
php artisan queue:listen
php artisan queue:work
Both failed.
Upvotes: 2
Views: 4163
Reputation: 2620
Things to check:
Try specifying the connection name: php artisan queue:work database
Else make sure your env file on EC2 refers to correct default QUEUE_DRIVER QUEUE_DRIVER=database
in this case
Check config/queue.php for right default settings, if you don't specify queue driver in env file default' => env('QUEUE_DRIVER', 'database')
Run php artisan config:cache
on your EC2 instance for reload the env changes.
And you only need to use only one of the 2 commands, recommended is php artisan queue:work
as its caches application state but run php artisan queue:restart
every time you push code changes.
It is recommended to install and configure supervisor: https://laravel.com/docs/5.8/queues#supervisor-configuration
It will take care of restarting the queue worker on EC2 restart or queue failure
Upvotes: 5