anindyaju99
anindyaju99

Reputation: 475

Akka stream: using persistence queues or event sourcing

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

Answers (1)

easel
easel

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

Related Questions