I’m new to reactive programming, the actor model and the challenges faced in concurrent systems.
From my understanding, pure actors should be used when there is concurrent access to a shared state in a complex system. It is a way of abstracting this complexity in a way that you can don’t have to deal with low level details.
Streams on the other hand are built upon actors, and deal with common challenges in actor models, like backpressure. They are a higher level API and useful for data transformations.
Now I want to build the following simple flow:
a) I need to retrieve data from an Azure Service Bus (there is a component in Akka.Streams I am aware of)
b) a part of this data is used to send a request to an external API (which can fail, obviously)
c) when the response was successful, the entity I receive should be transformed (this happens inside the application, I don’t talk to external services here)
d) when the transformation is successful, I want to forward that entity to another API.
the requirement is that no message received from the Service Bus should be lost, if step b) or d) does not work, I need to try again later, after some number of tries, I want to persist/log that data.
What am I missing to decide between actors vs Streams? I have a rough idea of what they are for, but cannot yet make an informed decision.