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

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
water
I’m aware of 2 such projects, are there others? git: GitHub - team-alembic/realworld: A fullstack Phoenix LiveView application with back...
New
itzmidinesh
Hi all, I’m working on a Phoenix project where I need to make external HTTP requests and I’m trying to choose between Req and HTTPoison....
New
peck
Hi everyone. My team and I have been working on a fairly modest app based around video streaming and chat, but we’ve landed a customer t...
New
leoschweizer
Hi, we run different LLM models across a cluster, with each node loading a configurable subset. Model-specific queues let nodes consume ...
New
csmr
Hi all, I’m new here and would like to hear peoples views on my Elixir/Phoenix based game-engine! :smiley: Mutonex gamedesign was finish...
New
Stef-Verniers
Hello I’ve been coding in Elixir for almost two years now because of my current job where we implemented Elixir in our application. But ...
New

Other Trending Topics Top

dominicletz
Hey there, I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first. ...
New
mudasobwa
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
KristerV
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
OndrejValenta
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly) AI dream has many faces, but general...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
kip
In 2021 I started a new library called Tempo with the objective of modelling time as a set of intervals - not as instants. In 2022 I gave...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews