Deploy AKKA-http

This is the first time I work with akka-http. I wrote the following main class that launches the application:

object Main extends App with Routes with Config with Protocols { implicit val system: ActorSystem = ActorSystem("slickboard-system") implicit val executor: ExecutionContext = system.dispatcher implicit val materializer: ActorMaterializer = ActorMaterializer() override val employeeActor: ActorRef = system.actorOf(EmployeeActor.props, "employees") val server = Http().bindAndHandle(route, httpServerURL, httpServerPort) } 

It starts the server on localhost, but when I try to deploy it to a remote tomcat server, it no longer works. It responds with HTTP 404: not found.

I searched the Internet for akka-http deployment but could not find the answer. Does anyone have experience with this issue?

Yours faithfully

+5
source share
2 answers

Akka-http is not intended to be deployed as a servlet, but is a standalone executable. One of the popular ways to deploy Akka applications is to use the sbt-native-packager plugin. It can create system packages for deployment, including deb and rpm packages with startup scripts to provide service-like behavior on Linux.

I recently answered a related question, but about the Play framework. Play and Akka are similar to deployment prospects, so look here: fooobar.com/questions/1245020 / ...

+11
source

akka-http is deployed with its built-in web server (the built-in web server, which is a "developed" version of akka sprayer). While Spray was able to be deployed to an external web server (as a servlet spray), this functionality was not ported to akka-http. There was some doubt in the community that the spray servlet would be something that would ever be ported to akka-http in the future. This is due to the fact that akka-http has evolved in such a way that it has ever been more closely related to the embedded server than the spray.

+2
source

Source: https://habr.com/ru/post/1245014/


All Articles