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

using Redis driver for queue, and problem with notifications. #29260

Closed
igunultas opened this issue Jul 22, 2019 · 8 comments
Closed

using Redis driver for queue, and problem with notifications. #29260

igunultas opened this issue Jul 22, 2019 · 8 comments

Comments

@igunultas
Copy link

  • Laravel Version: 5.8
  • PHP Version: 7.3.6
  • Database Driver & Version: MARIADB

Description:

While using Redis as a queue driver, and trying to send notification to broadcast it just ignores receivesBroadcastNotificationsOn on the model that has notifiable trait.

it keeps sending notifications to channel App.User.{userid}
instead of what receivesBroadcastNotificationsOn returns

if I use sync or sqs driver it just work fine.

Steps To Reproduce:

Create notification
Add receivesBroadcastNotificationsOn to model
set queue driver to Redis

@igunultas
Copy link
Author

@samuhay

Thanks for your reply BUT

The version im currently on is 5.8 and you are sending me the 5.4 docs, which doesn't resolve my issue since the code works with sqs and sync drivers.

@caferyukseloglu
Copy link

I think it is because you have customized the Notification channel using receivesBroadcastNotificationsOn() in User model and you are listening event on App.User.* not on user.*

So just remove receivesBroadcastNotificationsOn() from the User model and check again.

Hope this helps Can you share code ?

@igunultas
Copy link
Author

notifications.${this.userdata.userid}.${this.userdata.company}
this is the channel im listening.

public function receivesBroadcastNotificationsOn() { return "notifications.".$this->id.".".$this->company; }

this is the function on user model that uses Notifiable trait.

you are misunderstanding what im saying.

if I have something misconfigured it would not work on sqs or sync driver aswell.

@driesvints
Copy link
Member

Maybe related to #28701 ?

@igunultas
Copy link
Author

@drievints

I have tried couple more combinations, but there was no luck at all. it was showing the same behavior.

and I moved on didn't change anything about it since I decided to give it a try for Redis once more. rebooted both Redis and ec2 than it started working, no idea why but I think there is some caching going on.

I tried to dig deeper on framework and checked the files that are responsible for queueing but didn't see any caching so far.

since you are Laravel maintainer would you please try to guess what would be causing the issue, I would love to read your comments.

thank you.

@driesvints
Copy link
Member

@igunultas did you read the issue I linked to?

@LarryMckuydee
Copy link

@igunultas

It's work for me though, I'm using laravel 5.8.27
perhaps you should check if the queue connection and broadcast driver really using redis.
Also specify that custom private channel in routes/channel.php

@driesvints
Copy link
Member

I'm going to close this as a duplicate of #28701

I've already looked into it but currently stuck on figuring out where the messages get pulled back out from Redis. Any help is appreciated.

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

No branches or pull requests

4 participants