You can add shutdown hook:
// import scala.concurrent.duration._
//shutdown Hook
scala.sys.addShutdownHook {
logger.info("Terminating...")
actorSystem.terminate()
Await.result(actorSystem.whenTerminated, 30 seconds)
logger.info("Terminated... Bye")
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…