Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Fijvect's avatar

Horizon missing broadcast queue?

Hello! I'm reaching out for help after 2 days of trying to figure this out and googling the hell out of it :(

I'm trying to implement a very standard sort of messaging platform. I have everything working... sometimes.

When an event is broadcast, Laravel Horizon (using redis) shows it successfully entering the queue and completing. Pusher shows my user as successfully connecting and the channel is then "Occupied" in their debug console. However, my event's broadcast is not making it to pusher.

Here's the strange part: I have only one queue configured I'm pretty sure, the "default" queue. But I am able to make the event broadcast to pusher correctly ONLY if I run php artisan queue:listen. So while the event successfully shows in horizon/redis, it is not firing to pusher unless I catch the event using that command.

This feels like a configuration error, so I guess I'll show that data below... but please let me know if you'd like to see anything else while considering whether or not you can help!

Thanks!

config/app.php:

    //Uncommented!!:
        App\Providers\BroadcastServiceProvider::class,

config/broadcasting.php:

    'default' => env('BROADCAST_DRIVER', 'pusher'),

    'connections' => [

        'pusher' => [
            'driver' => 'pusher',
            'key' => env('PUSHER_APP_KEY'),
            'secret' => env('PUSHER_APP_SECRET'),
            'app_id' => env('PUSHER_APP_ID'),
            'options' => [
                'cluster' => env('PUSHER_APP_CLUSTER'),
                'encrypted' => true,
            ],
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
        ],

        'log' => [
            'driver' => 'log',
        ],

        'null' => [
            'driver' => 'null',
        ],

    ],

config/queue.php:


    'default' => env('QUEUE_CONNECTION', 'sync'),


    'connections' => [

        'sync' => [
            'driver' => 'sync',
        ],

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

        'beanstalkd' => [
            'driver' => 'beanstalkd',
            'host' => 'localhost',
            'queue' => 'default',
            'retry_after' => 90,
            'block_for' => 0,
        ],

        'sqs' => [
            'driver' => 'sqs',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
            'queue' => env('SQS_QUEUE', 'your-queue-name'),
            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
        ],

        'redis' => [
            'driver' => 'redis',
            'connection' => 'default',
            'queue' => env('REDIS_QUEUE', 'default'),
            'retry_after' => 90,
            'block_for' => null,
        ],

    ],

.env: (truncated...obviously)

BROADCAST_DRIVER=pusher
CACHE_DRIVER=file
QUEUE_CONNECTION=redis
SESSION_DRIVER=file
SESSION_LIFETIME=120
0 likes
2 replies
Fijvect's avatar
Fijvect
OP
Best Answer
Level 1

Anyways, for those of you who also come across issues like this, it turns out that you have to forcibly restart your queue workers, flush the queue, and then restart the workers in order for it to use your updated code. I wasn't aware of this!

This makes perfect sense now on why new queue workers would perform correctly, but the existing ones in horizon wouldn't.

For me, using horizon, I accomplished this with the following:

  1. php artisan horizon:terminate
  2. php artisan cache:clear
  3. php artisan horizon:continue
1 like
garethredfern's avatar

This helped me out massively! Thank you, I thought I was going mad doing exactly the same.

Please or to participate in this conversation.