Hello all,
When I provide a resuming materializer to the stream, the exceptions that occurred in the stream do not get logged. Is there any way to log these exceptions?
import akka.actor.ActorSystem
import akka.stream.scaladsl.Source
import akka.stream.{ActorMaterializer, ActorMaterializerSettings, Materializer, Supervision}
import scala.concurrent.duration.DurationInt
object Demo extends App {
private implicit val actorSystem: ActorSystem = ActorSystem()
lazy val settings: ActorMaterializerSettings =
ActorMaterializerSettings(actorSystem).withSupervisionStrategy(Supervision.getResumingDecider)
implicit lazy val resumingMat: Materializer = ActorMaterializer(settings)
var counter = 0
def eventGenerator(): Int = {
counter += 1
if (counter > 5) throw new RuntimeException("Could not create an event")
else 1
}
Source.tick(0.millis, 10.millis, ()).map(_ ⇒ eventGenerator()).runForeach(println)
}