Skip to content

Commit

Permalink
Merge pull request #147 from vaslabs/scala-steward/update/akka-http-1…
Browse files Browse the repository at this point in the history
…0.2.0

Scala steward/update/akka http 10.2.0
  • Loading branch information
vaslabs authored Aug 11, 2020
2 parents b21dcac + d641441 commit 6c4e564
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object EndpointResolver {

def transformRequest(request: HttpRequest, hitEndpoint: HitEndpoint): IO[HttpRequest] = IO {
request
.copy(uri = request.uri.withHost(hitEndpoint.service).withPath(Path(hitEndpoint.targetPath))
.withUri(uri = request.uri.withHost(hitEndpoint.service).withPath(Path(hitEndpoint.targetPath))
.withPort(hitEndpoint.port)).withHeaders(request.headers.filterNot(_.name == "Timeout-Access"))
}

Expand Down
4 changes: 1 addition & 3 deletions gateway/src/main/scala/talos/gateway/ExecutionApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object ExecutionApi {


private def hostConnectionPoolConfig(maxInflightRequests: Int)(implicit actorSystem: ActorSystem[_]): ConnectionPoolSettings =
ConnectionPoolSettings.default(actorSystem.toClassic)
ConnectionPoolSettings.default(actorSystem)
.withMinConnections(1 + maxInflightRequests / 4)
.withMaxConnections(maxInflightRequests)
.withMaxOpenRequests(maxInflightRequests * 4)
Expand All @@ -90,8 +90,6 @@ object ExecutionApi {
val fromServices = gatewayConfig.services.map {
service =>

implicit val classicSystem = actorSystem.toClassic

val poolClientFlow = Http().cachedHostConnectionPool[Promise[HttpResponse]](
service.host,
service.port,
Expand Down
7 changes: 2 additions & 5 deletions gateway/src/main/scala/talos/gateway/GatewayServer.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package talos.gateway

import akka.actor.typed.scaladsl.ActorContext
import akka.actor.typed.scaladsl.adapter._
import akka.http.scaladsl.Http
import akka.stream.Materializer
import kamon.Kamon
import talos.gateway.config.GatewayConfig

Expand All @@ -15,13 +13,12 @@ class GatewayServer private(gatewayConfig: GatewayConfig)(implicit actorContext:

private[gateway] val start: Future[Http.ServerBinding] = {
val gateway = Gateway(gatewayConfig)(actorContext)
implicit val materializer = Materializer(actorContext)
import scala.concurrent.ExecutionContext.Implicits._

implicit val actorSystem = actorContext.system.toClassic
implicit val actorSystem = actorContext.system

for {
serverBinding <- Http().bindAndHandle(gateway.route, gatewayConfig.interface, gatewayConfig.port)
serverBinding <- Http().newServerAt(gatewayConfig.interface, gatewayConfig.port).bind(gateway.route)
} yield serverBinding
}

Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ object Dependencies {
val circe = "0.13.0"
val kamon = "2.1.4"
val scalatest = "3.0.8"
val akkaHttp = "10.1.12"
val akkaHttp = "10.2.0"
val monix = "3.2.2"
val gatling = "3.1.0"
val wiremock = "2.27.1"
Expand Down

0 comments on commit 6c4e564

Please sign in to comment.