Closed MartyHimmel closed 4 months ago
Hey @MartyHimmel - I would maybe take a slightly different approach here and instead let you actually specify the entire Redis connection information if you want.
Something like:
'scaling' => [
'enabled' => env('REVERB_SCALING_ENABLED', false),
'channel' => env('REVERB_SCALING_CHANNEL', 'reverb'),
'server' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'username' => env('REDIS_USERNAME'),
'password' => env('REDIS_PASSWORD'),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
],
Then pass that info into the PubSub class as an array. It's a bit more verbose on the configuration side but I think more flexible.
Thanks for the direction @taylorotwell! This is my first contribution to any part of Laravel, so I was trying to keep it minimal. 😅
The updated config is working well except for the failing Laravel 10 test. I'll push another update as soon as I figure out what's going on there.
Digging into that a bit more, it seems like the failing test above is unrelated (appears to be happening on the main
branch, too). Is there anything else I need to do with this?
@joedixon Done and done.
Thanks @MartyHimmel - just want to confirm, this configuration works with your cluster?
@joedixon Yep. I tried it on a localhost setup Friday and the server started. Just tried it on my work's dev environment (that's the one that uses AWS with the Elasticache/Redis cluster) and it started up without any issues.
Thanks again for yours and Taylor's direction! I'm excited to dig into this more and finally move our app out of long polling and into websockets. 😁
This adds a configuration setting and check to allow Redis in cluster mode (see issue #160). Adding
REVERB_SCALING_CLUSTER_ENABLED=true
to the.env
file will change the config used fromdatabase.redis.default
todatabase.redis.clusters.default.0
. Like the horizontal scaling feature, this is off by default.