Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel Reverb Does Not Support Redis Prefix for Scaling #305

Closed
mohamad-momeni opened this issue Jan 29, 2025 · 2 comments
Closed

Laravel Reverb Does Not Support Redis Prefix for Scaling #305

mohamad-momeni opened this issue Jan 29, 2025 · 2 comments

Comments

@mohamad-momeni
Copy link

Reverb Version

1.4.6

Laravel Version

11.40.0

PHP Version

8.3

Description

Overview
Laravel Reverb uses Redis only for scaling when running across multiple servers. However, it does not support setting a Redis prefix for its scaling mechanism. This can cause issues when running multiple Laravel applications using Reverb on the same Redis server, as they may interfere with each other's pub/sub channels.

Expected Behavior
Each Laravel application should be able to define a unique Redis prefix so that its Reverb scaling events are isolated from other applications using the same Redis instance.

Actual Behavior
Laravel Reverb does not respect Laravel’s REDIS_PREFIX setting.
All applications using the same Redis server will share Reverb’s scaling channels (e.g., reverb:server:*), leading to conflicts.
There is no built-in way to namespace or separate Reverb’s Redis pub/sub channels per application.

Steps To Reproduce

  1. Set up two Laravel applications (App1 and App2) with Laravel Reverb and Redis as the scaling mechanism.
  2. Ensure both applications use the same Redis instance.
  3. Run php artisan reverb:start on both applications.
  4. Broadcast an event from App1 and notice that App2 can also receive the event due to shared Redis pub/sub channels.
@joedixon
Copy link
Collaborator

Are you running a separate Reverb installation per app? If so, you can configure the channel name to be used in each app:

https://github.com/laravel/reverb/blob/main/config/reverb.php#L42

@joedixon
Copy link
Collaborator

Closing this issue for now. Feel free to reopen if my above response doesn't solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants