|
@@ -2,9 +2,8 @@ package com.typesafe.akka.http.benchmark
|
|
|
|
|
|
import akka.actor.ActorSystem
|
|
|
import akka.http.scaladsl.Http
|
|
|
-import akka.http.scaladsl.server.{Route, RoutingLog, RoutingSettings}
|
|
|
+import akka.http.scaladsl.server.Route
|
|
|
import akka.stream.ActorMaterializer
|
|
|
-import akka.stream.scaladsl.Sink._
|
|
|
import com.typesafe.config.Config
|
|
|
|
|
|
trait Bootstrap {
|
|
@@ -23,15 +22,8 @@ class BenchmarkBootstrap(components: {
|
|
|
|
|
|
override def run(): Unit = {
|
|
|
|
|
|
- implicit val routingLog = RoutingLog(system.log)
|
|
|
+ implicit val system = ActorSystem()
|
|
|
implicit val materializer = ActorMaterializer()
|
|
|
- implicit val settings = RoutingSettings.default(system)
|
|
|
- val handler = Route.asyncHandler(components.route)
|
|
|
- val server = Http(components.system).bind(config.getString("akka.http.benchmark.host"), config.getInt("akka.http.benchmark.port"))
|
|
|
- server.to {
|
|
|
- foreach { connection =>
|
|
|
- connection.handleWithAsyncHandler(handler)
|
|
|
- }
|
|
|
- }.run()
|
|
|
+ Http().bindAndHandle(components.route, config.getString("akka.http.benchmark.host"), config.getInt("akka.http.benchmark.port"))
|
|
|
}
|
|
|
}
|