artem

artem

Commanded (and other CQRS/ES) **instead** of the long running jobs

Hi all

I am trying-learning CQRS via a semi-hobby project on analyzing customer feedback. Basically you upload comments, system runs AI on it extracting sentiments, topics, statements and whatnot.

This seems like quite an easy playground to try Commanded for CQRS: things are quite asynchronous in nature, write and read activities are easy to separate and.. I am not sure what to do with the command enriching moments.

The problem
User feedback needs to be passed to external API (or local process, that’s conceptually same) which can take time to execute, can fails completely and forever or can fail temporarily (API is temporarily down or I went over the hourly quota), so exponential retry is to be used several times.

I believe I understand relatively well how to do in a CRUD-like app with queues (be it Oban, Rihanna or RabbitMQ) and in the past was even doing very similar things in Java. What I am not sure about is how to mix it with CQRS. I was reading Commanded’s options on enriching via middleware or during handling the command, but can’t figure how to do retries there.

What do you do?
What do you do in similar situations when external API fails and needs to be retried?

  • Are you recording an API failure by generating a “failed” event which process manager uses to generate retry command?
  • Are you handling retries completely out of command processing so that e.g. middlewhere only passes the command further when all the retrying options are done even if it takes several days? And use separate queue/jobs for the retrials?
  • Something completely different?

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement