|
@@ -2,7 +2,7 @@ package com.typesafe.akka.http.benchmark
|
|
|
|
|
|
import akka.actor.ActorSystem
|
|
import akka.actor.ActorSystem
|
|
import akka.http.scaladsl.Http
|
|
import akka.http.scaladsl.Http
|
|
-import akka.http.scaladsl.server.{Route, RoutingLog, RoutingSettings, RoutingSetup}
|
|
|
|
|
|
+import akka.http.scaladsl.server.{Route, RoutingLog, RoutingSettings}
|
|
import akka.stream.ActorMaterializer
|
|
import akka.stream.ActorMaterializer
|
|
import akka.stream.scaladsl.Sink._
|
|
import akka.stream.scaladsl.Sink._
|
|
import com.typesafe.config.Config
|
|
import com.typesafe.config.Config
|
|
@@ -26,11 +26,11 @@ class BenchmarkBootstrap(components: {
|
|
implicit val routingLog = RoutingLog(system.log)
|
|
implicit val routingLog = RoutingLog(system.log)
|
|
implicit val materializer = ActorMaterializer()
|
|
implicit val materializer = ActorMaterializer()
|
|
implicit val settings = RoutingSettings.default(system)
|
|
implicit val settings = RoutingSettings.default(system)
|
|
- implicit val setup = RoutingSetup.apply
|
|
|
|
|
|
+ val handler = Route.asyncHandler(components.route)
|
|
val server = Http(components.system).bind(config.getString("akka.http.benchmark.host"), config.getInt("akka.http.benchmark.port"))
|
|
val server = Http(components.system).bind(config.getString("akka.http.benchmark.host"), config.getInt("akka.http.benchmark.port"))
|
|
server.to {
|
|
server.to {
|
|
foreach { connection =>
|
|
foreach { connection =>
|
|
- connection.handleWithAsyncHandler(Route.asyncHandler(components.route))
|
|
|
|
|
|
+ connection.handleWithAsyncHandler(handler)
|
|
}
|
|
}
|
|
}.run()
|
|
}.run()
|
|
}
|
|
}
|