What happen to the Restarted source when system is restarted?

I have a Subscriber, which would subscribe to a topic. each message which subscribed, will be put into the source, and wrapped by RestartSource. When there is any exception with the Source, it will not emit any failure, since it will be handled by RestartSource. but while, RestartSource is restarting and trying, what would happen to the message when the system suddenly automatically shut down by Kubernetes? Will I lose this message? Or will it restart/re-subscribe this message again?

This depends on your Subscriber: RestartSource does not persist any data between system restarts, so if your Subscriber acknowledges each message as soon as it is received, indeed it will be lost. For that reason you might want to postpone acknowledging the message until you’re sure you have processed it. How to do that depends on the Subscriber you are using.

im using a topic subscriber. here is my subscriber code

fooService.fooTopic().subscribe
    .atLeastOnce(
		Flow[fooMessage].map {
			case fooXMessage => foo()
			case fooYMessage => foo()
		}.async.map{ _ =>
			Done
		}
	)
	
private def foo() = {
	RestartSource.onFailuresWithBackoff(
      minBackoff = 1 seconds,
      maxBackoff = 20 seconds,
      randomFactor = 1,
      maxRestarts = 10
    ) { () =>
		val futureResult: Future[Any]
		
		Source.future(futureResult)
        .map {
          case Failure =>
            throw new RuntimeException("testing BackOff")
          case Success =>
            println("FINISH")
          case _ => println("else")
        }
	}.runWith(Sink.head)
     .recoverWith {
        case _ =>
          println("exceed retries")
      }.foreach(println)
}

Do I need to add some config? I thought that the subscriber will restart the message when I didnt return any Done. but that doesnt seem to be the case.