RPC not broadcast message #162
Replies: 1 comment · 11 replies
-
Hey! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi @palkan thank you for quick responce cable.yml
development.rb
ActionCable.server.pubsub
anycable.yml
bundle exec anycable
anycable-go --port=8080
log
and on close event
Looking at logs I`ve added marker here. 'anycable/rails/action_cable_ext/channel.rb' AndI see that 'anycabled?' method returns false,
other methods here using super unless anycabled? |
Beta Was this translation helpful? Give feedback.
All reactions
-
As I see from the logs, you're connecting to the Action Cable server:
I guess, that's the problem; you should use your anycable-go server URL to connect to. Make sure this line sets the URL (or check your client code, maybe, it's using a hardcoded URL value): config.action_cable.url = ActionCable.server.config.url = ENV.fetch('CABLE_URL', 'ws://localhost:8080/cable') |
Beta Was this translation helpful? Give feedback.
All reactions
-
@palkan You was right, problem was with url which referred to port :3000 and pass to ActionCable as result.
here is my anycable logs. I see that it broadcasting, but nothing on client side.
|
Beta Was this translation helpful? Give feedback.
All reactions
-
There is a race condition: subscribing and broadcasting happens concurrently, there is no order guarantee. With Action Cable, it works most of a time since everything is happening within the same Ruby process (at least, locally), and thus, the Consider using - NotificationChannel.broadcast_to(non_session_user, {'name' => 'lastname'})
+ transmit({'name' => 'lastname'}) |
Beta Was this translation helpful? Give feedback.
All reactions
-
@palkan thank so much. |
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Hi, i have set up any cable with docker and the message not broadcasting some how, i got this error
and if i remove
stream_from "room_channel_#{params[:room_id]}"
the error is gone and i can connect to channel but it is not received the datathis is room_channel.js
my room_channel.rb
this is docker-compose
this is log for anycable-go container, is it running?
this is log for anycable (normally when the message broadcast message, it should called RPC Connect right? because on my local it show log RPC Connect but on production this log is nothing like below)
Beta Was this translation helpful? Give feedback.
All reactions