Hi everyone,
I am new to Akka HTTP and the first problem I encountered is how to handle ctrl+c in sbt shell to stop my Akka HTTP application running. After ctrl+c in sbt shell, I cannot run my Akka HTTP application again because it says that “java.net.BindException: [localhost/127.0.0.1:8000] Address already in use”. I believe that I need to implement a graceful shutdown hook for my jvm process running in sbt shell but the documents on the net (and akka http) did not help. I would be happy if one of you let me know how to write a shudown hook for my Akka HTTP application so that I can rerun my application again after ctrl+c, this will help me solve the issue of “java.net.BindException: [localhost/127.0.0.1:8000] Address already in use”.
Best wishes,
-halil.
2 posts - 2 participants