How to send a task to a specific queue in Lumen 5.5

In a standard task, I use this method to submit a task:

dispatch(new PurchaseJob($trxId, $method, $params));

Next, I want to send another job to send email, but I want to split it into another separate queue. From what I read in the Laravel 5.5 docs, I could do this:

SendEmailJob::dispatch($userEmail)->onQueue('send_email');

But this does not work on Lumen 5.5.

What can I do to make this work, or is there any other method that is not listed in the docs?

+4
source share
1 answer

I just managed to find a way to send the queue with the specified name in Lumen 5.5.

public function toMail($notifiable)
{
    $job = (new SendFriendRequestEmail($notifiable))->onQueue('email');
    dispatch($job);
}

Maybe this article will help you understand more.

+3
source

Source: https://habr.com/ru/post/1687149/


All Articles