Sanjibukai

Sanjibukai

Message Queue or an Event Bus system?

Hello everybody,

I tend to see Message Queues (like RabbitMQ) being relevant when we want to make communicate different apps through events (the apps might be running on different servers or as microservices or even on client apps).

However (and hopefully) with Elixir apps I tend to have one single “app” (maybe umbrella apps) and in this case the Message Queue system might be more of what we are calling an Event Bus..

So I wanted to know if it still makes sense to use a Message Queues (like RabbitMQ) in this context?
Or does it better to use some kind of Elixir baked solutions (GenServers, Phoenix PubSub, some external library like event_bus)?

I would love to hear if you are using Event Bus and if so what you are using?

Most Liked

randito

randito

I think if you’re crossing lines – where a line might be a different language, a different node, a different speed of execution – then something like RabbitMQ might be a better choice. It’s got clients in lots of different languages.

stefanchrobot

stefanchrobot

If you decide to hide it behind some kind of interface (e.g. MyApp.EventBus) you can pick whatever tool works for you. Then I think it boils down to whether you need persistent events and the expectations towards latency between sending and receiving the event.

dimitarvp

dimitarvp

Umbrellas don’t prevent you from sending messages to other processes without using any external message queue software.

As @stefanchrobot said, it depends if you want persistence. If you don’t, plain old GenServers will serve you more than adequately enough.

Where Next?

Popular in Discussions Top

CharlesO
Erlang :list.nth simple, but 1 - based nth(1, [H|_]) -> H; nth(N, [_|T]) when N > 1 -> nth(N - 1, T). Elixir Enum.at … coo...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
tomekowal
Hey guys! I want to create a toy project that shows a chart of temperature over time and updates every 5 seconds. I feel LiveView is per...
New
fireproofsocks
I’ve been working on an Elixir project that has required a lot of scripting. I usually reach for Elixir because I like it more (and in th...
New
AstonJ
Another chat test please ignore Another chat test please ignore Another chat test please ignore Another chat test please ignore Another c...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 131117 1222
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement