Skip to content
Advertisement

jobs failed table using redis as queue driver in the Laravel

I’m using Redis as a Queue Driver for my jobs, but the failure table receives a specific driver configuration in the config / queue.php file, which left me a little confused. Because even setting Redis as a driver for my queues, the faults continue to be registered in a relational database table defined in a specific session of the file. Defining the fault table driver as Redis doesn’t seem to work, because Redis doesn’t have a table.

I did some research but I didn’t find any clear explanation for that. I really should to use a relational database just to store job failures?

enter image description here

Advertisement

Answer

Yes you are right, there is no “table” concept in Redis. There are only three options available in the most recent version of the framework.

  • Relational Database
  • DynamoDB
  • Null (don’t log)

Another option could be using Laravel Horizon. According to the documentation;

The horizon configuration file allows you to configure how long recent and failed jobs should be persisted (in minutes). By default, recent jobs are kept for one hour while failed jobs are kept for a week.

It will use Redis to save your failed jobs, doesn’t require a relational database.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement