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!

Rob
  • 2,243
  • 4
  • 29
  • 40
Ali Zain
  • 610
  • 7
  • 24

2 Answers2

0

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.

  • 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. – Ali Zain Jun 22 '23 at 20:05
-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.

sashaegorov
  • 1,821
  • 20
  • 26
  • 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 ... – Alexander Znaydyuk Jan 25 '18 at 13:27
  • Should work by changing it to Redis. Also see https://stackoverflow.com/questions/39487252/redis-queue-failed-job-is-being-logged-to-mysql – rhand Jul 28 '18 at 00:52
  • This is the exact same wrong answer as linked in the comment by rhand – jonlink Oct 26 '21 at 20:25