Laravel Failed Jobs to Redis
Asked Answered
P

2

10

I am trying to configure my Laravel app so all my Laravel Queue Failed Jobs goes to Redis instead of mysql.

Currenly my jobs are configured to use redis but failed_jobs still goes to MySql Database

Didn't find anything on StackOverflow/Laravel

Laravel 5.4

Redis

PHP 7.0

Please help!

Porky answered 23/10, 2017 at 8:29 Comment(1)
You need to set failed connection in queue.php fileStratify
V
1

I think you are trying to use Redis wrong. you should store your failed job in a right database like PostgreSQL or MySQL. Laravel just use Redis for queue as a "Broker" because Redis has built-in queue data structure and can efficiently handle queues with minimum effort and with high performance. consider to store your failures and results of them in a separated database for examine them later.

Volva answered 14/6, 2023 at 10:58 Comment(1)
For a big job processing, we need to monitor a large of failed jobs, redis do this job effectively but MySQL got connection limits and hence crashes. At that time, I posted question, 5years and 8 months ago, I didn't find any solution.Porky
Q
-2

Check your settings in config/queue.php, you should find following values:

'failed' => [
    'database' => env('DB_CONNECTION', 'mysql'),
    'table' => env('QUEUE_FAILED_TABLE', 'failed_jobs'),
]

Change the connection and table on whatever you need.

Quilting answered 1/12, 2017 at 8:53 Comment(3)
I think that laravel redis driver don't configured to store failed jobs info. I use postgre and it works fine. I also tried to change config and find failed jobs info in redis, but unsuccessful. So I suppose there are no way to store failed_jobs in key value storage. It requires relational database with tables, config file values allude to that. And if think about it, why are we trying to put failed_jobs to redis? I just stick with postgre ...Quilting
Should work by changing it to Redis. Also see #39487752Fire
This is the exact same wrong answer as linked in the comment by rhandBunnell

© 2022 - 2024 — McMap. All rights reserved.