I am studying Job dispatching from here
Problem
I read that each connection has queue parameter which tell the queue name. Question is: How can I set the priority to send low or medium or high priority email?
Cmd prompt
I am using command: php artisan queue:listen to process job.
What I tried?
php artisan queue:work --queue=high,default
but this code never works if connection's queue parameter has value is not high
Default Queue Driver
'default' => env('QUEUE_DRIVER', 'database'),
Queue Connections
'connections' => [
'Register' => [
'driver' => 'database',
'table' => 'tbljobs',
'queue' => 'low',
'retry_after' => 5,
],
'ForgotPassword' => [
'driver' => 'database',
'table' => 'tbljobs',
'queue' => 'low',
'retry_after' => 5,
],
],
.env
QUEUE_DRIVER=Register
Controller Code for Register email
$job = (new SendActivationEmail($Data))
->onConnection('Register');
dispatch($job);
Controller Code for Reset Password
$job = (new SendResetPasswordEmail($this->tokens->create($user), $user))
->onConnection('ForgotPassword');
dispatch($job);