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

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
matt-savvy
Anyone here using Honeybadger? My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of Bandit.HTTPError...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews