Multiple queues in AWS with Laravel stop running after sometime

29 Views Asked by At

I have the following setup: Laravel on Elastic Beanstalk and queues per database. I want to archieve that there are three different queues running in parallel in order to have notifications triggered faster and so on.

Now, my problem is the queues start running as soon as I push to the codepipeline (connected to Elastic Beanstalk), but they stop working after some time until I push again something to the Code Pipeline. Any idea what I need to do to keep them running?

The .env contains:

QUEUE_CONNECTION=database

Then in my queue.php

  'connections' => [
    'database' => [
        'driver' => 'database',
        'table' => 'jobs',
        'queue' => 'default',
        'retry_after' => 90,
    ],
    'airbnb_sync' => [
        'driver' => 'database',
        'table' => 'jobs',
        'queue' => 'default',
        'retry_after' => 90,
    ],
    'arrange_room_dates' => [
        'driver' => 'database',
        'table' => 'jobs',
        'queue' => 'default',
        'retry_after' => 90,
    ],
]

In the job SyncAirbnb I have

 public function __construct()
{
    $this->onQueue('airbnb_sync');
}

and then finally I have in .platform/files/supervisor.ini

[program:laravel_queue]
process_name=%(program_name)s_%(process_num)02d
command=php artisan queue:listen --queue=database,default --tries=1
directory=/var/app/current
stdout_logfile=/var/log/supervisor-laravel-worker.log
logfile_maxbytes=0
logfile_backups=0
redirect_stderr=true
autostart=true
autorestart=true
user=root
startretries=86400


[program:arrange_room_dates]
process_name=%(program_name)s_%(process_num)s
command=php artisan queue:listen --queue=arrange_room_dates --tries=1
directory=/var/app/current
stdout_logfile=/var/log/supervisor-laravel-worker.log
logfile_maxbytes=0
logfile_backups=0
redirect_stderr=true
autostart=true
autorestart=true
user=root
startretries=86400


[program:airbnb_sync]
process_name=%(program_name)s_%(process_num)s
command=php artisan queue:listen --queue=airbnb_sync --tries=1
directory=/var/app/current
stdout_logfile=/var/log/supervisor-laravel-worker.log
logfile_maxbytes=0
logfile_backups=0
redirect_stderr=true
autostart=true
autorestart=true
user=root
startretries=86400
0

There are 0 best solutions below