max-vc
Hi All,
I am building a instant messaging app with Phoenix backend.
I use unique user name as the channel name,so user can send msg to each other base on name.
Now I have two nodes running, and they connect each other.
The question is how can I know the message can not reach to other node, for example the target node crash.
and shall I check the user, connect to which node, and check if the node is online, before boradcast or send the message?
Thanks.
Trending in Questions
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
Hello,
I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind.
However, when I launch mix phx.server, I get an error...
New
I really like the adapter patterns that ecto, nebulex, waffle, etc. use and would love find something similar for a key management servic...
New
I’m working on a small exercise involving update_in/3, and I came up with this solution:
data = %{
name: "Periodic Table",
category:...
New
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication):
toke...
New
Hello folks!
So at work, we are seeing some situations where we have to define some “fixed” strings that are used across the codebase in...
New
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hubertlepicki
It is very little info about what you are doing in terms of how your infrastructure and code is set up, but sending back acknowledged message generally seems like the way to go…
max-vc
Thanks for the suggestion.
yes, I shall user ACK flag to decide whether resend message when user connect back.
here is the code I broadcast user’s message,
the question is shall I check the user or user’node is online , before broadcast the message?
hubertlepicki
I think the main problem here is that you are using Phoenix.PubSub (endpoint.broadcast), which is precisely what it says it is: a pub-sub mechanism. The pub-sub mechanisms generally are fire and forget, and Phoenix does it precisely this way. So, if you want to listen to some ack message it is up to you for implementation and it won’t be super easy, as you have to handle timeouts, out-of-order messages etc.
What I would do instead is to maybe register process globally within a cluster and then perform a normal GenServer.call. GenServer already sets up monitor on the destination process, and will error if the
pidyou are trying to send message to crashes, it also waits for the response blocking so after yourGenServer.callfinishes, you will be sure the destination process did in fact receive message and didn’t crash processing it.There is a number of ways to perform gluster-wide process registration, and maybe you’d need grouping them too. There’s
pg2andHorde.Registrybut also:globaland others. I would have a look at Horde as this is what I am using and works pretty much flawlessly in my, relatively simple, scenarios.max-vc
Thank you so much.
I am not aware Elixir has this concept: process registration. since your last reply, I am looking at
Phoenix Tracker, try to find a way to register the user-process info when join the channel.seems the
Horde.Registryis the answer.Sir, last question, as the IM app may has millions clients connected, shall I worry the performance when use
Horde.Registery?