Answer the question
In order to leave comments, you need to log in
Why don't queues fire without artisan queue:listen command in LARAVEL?
I sent the account activation code to email via Queue. This should fire when a user registers on the site. Messages come (it works only) when I execute the command on the server artisan queue:listen
. Yes, this is despite the fact that registrations made before this team do not come at all. Only those that are made when the command has already been executed come artisan queue:listen
.
But shouldn't it work without artisan queue:listen
?!
Moreover, in the terminal, when it is already running, it artisan queue:listen
is entered (without stopping):
[Illuminate\Database\Eloquent\ModelNotFoundException]
No query results for model [Cartalyst\Sentinel\Users\EloquentUser].
app/Jobs/SomeQueueClass.php
(methods __consturct($user_id)
and handle()
).
Answer the question
In order to leave comments, you need to log in
Yes, that's fine - that's how it's supposed to work.
The principle of the queue is as follows: you stuff your small tasks into the tube (tube, channel) (for example, sending soap to one user), at this time a process is hanging that listens to your tube and as soon as tasks appear in it, it starts processing them.
If your load is not large or you don't want to play with the queue - you can put "sync" as the driver - the message will go as usual.
If queues are needed, I recommend reading about daemonizing the listener process or about the supervisor
laravel.com/docs/5.1/queues#supervisor-configuration
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question