Reputation: 475
In an Akka stream application, if the application crashes/node goes down, I run the risk of losing the in-flight messages.
What can be done to ensure we don't lose the messages and they are played once the application comes back.
In my application, mapAsyns do IO calls and some minor CPU bound tasks.
In a pure Akka application I will go for either persistent queues or event sourcing. But in case of Akka stream since I don't have access to the underlying queues, how can I ensure that no message inside the stream is lost?
Upvotes: 1
Views: 772
Reputation: 4048
You will need to checkpoint the stream sink and then resume the source based on the last successful checkpoint if it crashes. You can do the checkpoint and resume using a persistent queue or event sourcing as you mention.
Upvotes: 2