Queues in Laravel: Main Things You Need to Know (Two Examples)

preview_player
Показать описание
"Overview" of this big topic in 12 minutes.

Links mentioned in the video:

Related tutorials on Laravel Daily:

Support the channel by checking out my products:

Other places to follow:
Рекомендации по теме
Комментарии
Автор

And just a warning for anyone using Redis Cluster for queues, the Laravel docs mention it, but it's a "blink and you'll miss it" situation: You'll need to name your queues with key hash tags, so "{default}" instead of "default". The name persists for the Supervisor config "artisan queue:work --queue={default}" (or whatever your queue name is). The curly braces matter!

DavidMachiavello
Автор

"If you change something in the code queue:work it doesn't automatically restart and take the changes of your code" ---> Very useful to know that. I have been trying to find why a weird bug was not fixed after I refactored my code, and it turned out I had to cancel the queue:work and run it again to get the chances!

christostsangaris
Автор

As someone that uses queues day-to-day, I believe you covered all the basic stuff. Horizon definitely a must, personally. Touched on the point about restarting schedule:work / Horizon with the new code; excellent point. Might have been a time or two of head scratching before realizing I didn't restart 🙃
You used email as the classic example for usage. To give another example, we use it for processing fetched API data.

bagsmode
Автор

Great video, concise and so informative. Thanks!

dendev
Автор

We have decoupled our queue workers to an extra VM. A big challenge was the enforced Kerberos authenticiation to the database (by security-standard for SQL Servers).
This made our production environment much more complex, but queues/redis/supervisor are absolutely worth it.
I also would emphasize, that in production you want to monitor the queue workers automatically, and react quickly if they fail (i.e. connection loss, Kerberos-ticket expiration, etc..).

matthiasbackhaus
Автор

Didnt expect to understand the topic immediately that took me months just to learn via documentation in 12 mins. Thankyou. I didnt use this due to my server restrictions in production so i have no way to set it up and test it. All ive been doing is trying this in localhost. This gave me some idea on how to do it on prod.

SilVer-hups
Автор

Btw. You can use “php artisan queue:listen” instead of having to restart the queue every single time during development. But you should still use queue:work in production since its more efficient as the docs say.

carterdee
Автор

First: thx for the video
Second: i will prefer to spend 15 minutes to see a video like this because it s for my career and because hearing you speaking faster its a bit strange it s like hearing my pm we have a 500 in production
Thirty: I think its very important to configure the max retries and the logic on fail because I had 5k event s in sentry because of a job that retried continuously in 24 h

GHEORGHELUPU
Автор

While using mailtrap on free version and queues, you can only send 5 mail per 10 sec. If your queues send more than 5 then it'll fail on 6th mail. You need either upgrade your mailtrap subscription or use queue rate limiting.

prabinkhadka
Автор

Nice one @Laravel Daily! Why isnt the ShouldQueue not implemented on Mailable by default? Any reason?

christostsangaris
Автор

Great Video 🎉 could you explain the serializesModel Trait and also explain your Approach to handle deleted models in queues.

tonimahoni
Автор

There is one issue I had experience using queue.
You need a bit careful if you want rename the class name / delete it, or even delete existing function, so the existing pending job won't breaking like error call to undefined method.
I am not sure why, I though I will use the newest code since deployer restart the horizon, but it looks like Pending Job cache the code maybe?
Have not do deep experience for this issue.

bboydarknesz
Автор

great video series ideea, thank you !

paulDD
Автор

Una de las cosas que lamento de las colas en laravel, es que no sé pueda usar el ID del usuario autenticado sin algún paquete como el de Mr Punyapal, por ejemplo.

Aún me queda mucho por aprender de su uso, pero por ahora, cada vez que las implemento, es todo bastante simple y eficiente

EduardR
Автор

Great video! Thanks so much for sharing! 👌🏽
I'm currently working on a project with queues, but I have a question. I set it up with Redis, and in the initial tests with Tinker, I saw the jobs in the queue. However, I ran some pest tests, and even now with Tinker, when the job is submitted to the queue, the queue list doesn't show it. The tests indicate that the assertions passed, but I don't know if everything is working correctly. I'm using Laragon, is this normal? Thanks so much in advance!

Автор

I am integrating with shipment company api and when the order is processing it should fire 3 apis create shipment , print lable (which is pdf link) and create pickup and I should save these info like shipment id which is returned from the api and the pickup guid, label also to make it as href in somepages so I did all the logic of integration in it's service and I handled it with observers the observes the order status to fire those 3 apis is that right ? or should I use queues and jobs ?

iconicae
Автор

Could you cover something about multiple queues? I use it somehow, however sometimes I get confused by launching multiple queue workes in Laravel

cardboarddignity
Автор

Hi. I am working on an association application. I want to create a billing system that allows users to make monthly payments. What do you think would be the most appropriate structure for scheduled tasks?

engbz
Автор

Someone on twitter just said that they processed 3 million jobs in 1 month using the db driver. Is there really a need for a redis queue for small to medium sized applications?

coolcha
Автор

Does the redis server come with it? I dont understand how redis work with it without having to install redis server? Would appreciate your reply

Faryalfamily
join shbcf.ru