Description
I've played for some time with horizon sinds you released the new capability for Horizon Support.
If I understand correctly the environment variable QUEUE_DRIVER
must be assigned the value redis
. (as stated in the documentation of Horizon)
When i was testing, my driver was by default rabbitmq
. But i couldn't get the failed_jobs working in Horizon.
When i was dispaching jobs, the jobs would be handled by horizon and when the jobs failed they wouldn't turn-up in the "Failed Job" section of horizon. Although they were marked as failed
in the section "Recent Jobs" section.
When I changed the default QUEUE_DRIVER
to redis
horizon worked as it should, but only when Jobs are dispatched over the connection redis
.
When I create Jobs and want to use RabbitMQ as broker, I have to assign/set the connection/driver to rabbitmq
for this created Job like so:
class ProcessUser implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
private $user;
/**
* Create a new job instance.
*
* @param User $user
*/
public function __construct(User $user)
{
$this->onQueue(kebab_case(class_basename(self::class)));
$this->onConnection('rabbitmq');
# Assign User model
$this->user = $user;
}
}
You can still override the connection/queue when dispatching the Job.
But when processing these rabbit jobs through horizon workers, the same behavior occurred. No failed_jobs in the "Failed Job" section.
Did you get this to work? What am i doing wrong? Am i missing something?
Originally posted by @adm-bome in #225 (comment)