Consider this simple stream:
Source(1 to 5)
.mapAsync(1) { i =>
if (i % 3 == 0) Future.failed(new Exception("I don't like 3"))
else Future.successful(i)
}
.withAttributes(
ActorAttributes.supervisionStrategy(Supervision.restartingDecider)
)
.runForeach(i => println(s"#$i"))
This actually prints
#1
#2
#4
Which is the same as with the resume strategy. I would expect the stream to restart after the failed future with the following output
#1
#2
#1
#2
...
- Why does the Resume and Restart strategy behaves the same way in this case?
- How can I restart the stream from start?