januarvs
Phoenix Channel - question on broadcast behavior on cluster
Hi,
I am learning about Phoenix Channel and have question on behavior of broadcast which not as I expected.
Environment: Windows 10, Phoenix 1.4.17, Erlang 22, Elixir 1.12
Nodes:
server@127.0.01, listening on port 4000
remote@127.0.0.1, listening on port 4001
Client:
client1 - wscat connects to server@127.0.0.1 on port 4000, then subscribe to “ping” topic.
client2 - wscat connects to remote@127.0.0.1 on port 4001, then subscribe to “ping” topic.
And here is my doubt, when I broadcast on server@127.0.0.1, only client1 receives the message.
When I broadcast on remote@127.0.0.1, only client2 receives the message.
I need help on what is exactly the correct behavior?
Thanks
Marked As Solved
trisolaran
Have you connected the two nodes? They need to be connected before they can chat with each other.
iex(remote@127.0.0.1)3> Node.connect(:"server@127.0.0.1")
Also Liked
sezaru
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex









