Recover from sink exceptions


My current flow looks like a MergeHub->grouping logic->db write->file write->Sink.ignore. Today our file write dropped an (IO)exception, and we lost a lot of data, bcs we stopped writing to the db too.
I have multiple .withAttributes(ActorAttributes.supervisionStrategy(decider))-s in the code (which is a log and a Supervision.Resume).

Is there a method/function, where if the downstream dies with an exception (multiple times), I can switch it to an another one? Like recoverWithRetries but as a Sink wrapper?

1 Like

Nothing out of the box right now, but I have recently implemented something like that for dealing with a failed downstream in Akka gRPC where I realized it could be a something generally useful (fix: Fail queued requests on connection failure #1423 by johanandren · Pull Request #1851 · akka/akka-grpc · GitHub ).

Relatively easy to implement yourself if you need it urgently.

Thanks @tg44 sharing this idea, at a very basic way, I think we should logging the error with an resume.