0

I'm using the Laravel 4.2 Queues service (http://laravel.com/docs/4.2/queues) for handling long-time ops. This helps me to handle the requests to server more quickly.

But how I can handle the next situation?

  1. The server puts the job to the queue and send a response to the client with accepted status.
  2. Then the system falls down.

I will lose all the jobs on the queue? Does Laravel Queues handles on its own this situation? How I could do it? How Laravel manage this situation when I make manually an artisan down?

Thanks!

joanlopez
  • 579
  • 1
  • 6
  • 17
  • Why would you lose all the jobs on the queues? The queue should persist jobs until an explicit Queue::delete(). What queueing system are you using? – Mark Baker Sep 04 '15 at 09:31
  • This means that If the system where is the queue service goes down, when I will rerun the service, it will continue with the pending jobs? Does Laravel 4.2 queues ensure that? I don't want to lose the jobs. I'm using the built-in queueing service. – joanlopez Sep 04 '15 at 10:05
  • It's up to the queueing mechanism to ensure persistence, not Laravel.... if you want to use Beanstalk or RabbitMQ or Amazon SQS or Redis, then it's their responsibility to ensure that jobs remain on the queue across a restart of the queueing service – Mark Baker Sep 04 '15 at 10:10
  • If you need to manually stop the service (or Laravel) then you should do an artisan queue::restart to close any currently running queued tasks in a controlled manner, and then start them up again after the service is restarted – Mark Baker Sep 04 '15 at 10:11
  • By "the built-in queueing service", I assume that you mean the default "synch".... note that this doesn't actually queue any jobs to anywhere, but "simulates" a queue; allowing you to use the queueing interface calls in your scripts so that switching to a real queue requires no additional changes to your code, only to the configuration – Mark Baker Sep 04 '15 at 10:13

0 Answers0