Beanstalkd - the definitive thread?
Hello all, I am looking for some definitive advice on using Beanstalkd as a queuing system and there appears to be very little direction online and from the Laravel docs. I am using Laravel Forge.
I recently moved to Beanstalkd from sync/database to handle my queues as it looked like a solid option. The issue is, I don't know if I've configured it correctly, yet it appears to be working albeit it has failed to send some emails.
Can I just clarify if these steps are correct?
-
.envfile -QUEUE_CONNECTION=beanstalkd - Installed Pheanstalk
composer require pda/pheanstalk ~4.0as written here: https://laravel.com/docs/10.x/queues#other-driver-prerequisites - Dispatch jobs within the code as expected:
public function sendEmail()
{
//
SendEmailJob::dispatch();
//
}
The issue is when it comes to actually listening to the queue... running on a local environment, I just run php artisan queue:work and it chugs away. But it doesn't appear this straightforward on Forge as some emails don't appear to send every time.
On Forge I go to the mysite.com > Queue and then define a worker status.
Once this is up and running, do I need to fire php artisan queue:work again? Or do I run it with the --once flag? And at one point do I need to run php artisan queue:restart? Do I need to restart the worker or the queue every time I deploy? There's so much conflicting information online but none of it seems to be in a consistent order.
Thank you so much for your help
Please or to participate in this conversation.