rump13

rump13

Hello. I’m seeking advice on the following scenario. I have a Phoenix app that needs to invoke an external URL to put a message on an external event bus every time a significant event happens (e.g., user-created). To ensure that I don’t lose messages in case the external system is down, I would like to implement a simple local queue mechanism with durable messages or something similar in Elixir to decouple my app from the external system. Additionally, I want to avoid deploying an external system like RabbitMQ and keep it simple by running it as another process inside my Elixir app.

I have explored these options:

  1. Implementing the queue mechanism myself using GenStage.
  2. Using the Stagger library, which seems to provide exactly what I need.
  3. Developing a PostgreSQL producer for Broadway (although I’m new to Elixir and not yet confident in implementing this).

How would you approach something like that? Are there any other elixir native solutions that I’m missing? I would appreciate your insights and advice.

Thank you

Showing Posts 1 to 5

al2o3cr

al2o3cr

What kind of volume are you expecting for these events?

Do you already have any kind of durable background jobs (Oban, etc) in the app?

If you do, the simplest approach would be to make “send a notification” into a job and rely on the tool.

v0idpwn

v0idpwn

I implemented something similar in Kafkaesque. Since I built it for work needs, it supports only Kafka. I’m planning to add support for custom adapters in the future. Maybe it can work as a reference for you.

Other options you might consider:

rump13

rump13 OP

The volume of messages will be low; I’m expecting something in the order of hundreds per day. I don’t have any durable background jobs for now because I’m in an early prototype stage of the app, but I’ll probably need one later. Do you think that I may want to start with something like Oban and, if necessary, replace it later if requirements change?

Something I forgot to mention in my question is that my app and the external system are running in different environments. My app is on-prem, so to reach the external event bus, I have to go to the internet.

dimitarvp

dimitarvp

I can’t speak how easy it would be to migrate off of Oban once you get invested in it – likely not as easy – but it otherwise covers your requirements for storing jobs somewhere and making sure each one is being executed at one point soon in the future.

And its asynchronous and not “do this absolutely immediately” nature lends itself well to the 3rd party laggy / slower APIs.

rump13

rump13 OP

Thank you all for your helpful answers. After taking my enterprise integration patterns off the bookshelves and removing the dust, I discovered the outbox pattern explained there as the guaranteed delivery pattern. Then I found the following article: Implementing Message Outbox Pattern with Oban.

I believe this solution will suffice. I’ll implement Oban as a message outbox and share my experience once it’s up and running.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
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
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews