I just created my first rest server with akka-http. The problem is that I do not know how to deploy the server in such a way that I could gracefully shutdown the actor syste
You could add to your main method
Runtime.getRuntime.addShutdownHook(new Thread() { override def run() { system.shutdown() system.awaitTermination() } })
Your app will wait until actor system will be shutt down and all postStop callbacks in your actors will be executed.
postStop