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