Skip to content

Commit

Permalink
More AS-120 followup: Update to latest akka-http version (#816)
Browse files Browse the repository at this point in the history
* update to latest akka-http version
  • Loading branch information
MatthewBemis committed Nov 16, 2020
1 parent cd0630e commit 02d25a0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
7 changes: 5 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import sbt._

object Dependencies {
val akkaV = "2.5.32"
val akkaHttpV = "10.1.12"
val akkaHttpV = "10.2.1"
val jacksonV = "2.10.0"
val jacksonHotfixV = "2.10.0" // for when only some of the Jackson libs have hotfix releases

def excludeGuava(m: ModuleID): ModuleID = m.exclude("com.google.guava", "guava")
val excludeAkkaActor = ExclusionRule(organization = "com.typesafe.akka", name = "akka-actor_2.12")
val excludeAkkaStream = ExclusionRule(organization = "com.typesafe.akka", name = "akka-stream_2.12")
val excludeAkkaHttp = ExclusionRule(organization = "com.typesafe.akka", name = "akka-http_2.12");
val excludeSprayJson = ExclusionRule(organization = "com.typesafe.akka", name = "akka-http-spray-json_2.12");

val rootDependencies = Seq(
// proactively pull in latest versions of these libraries, instead of relying on the versions
Expand All @@ -31,7 +33,8 @@ object Dependencies {
excludeGuava("org.broadinstitute.dsde" %% "rawls-model" % "0.1-18b1c01e0")
exclude("com.typesafe.scala-logging", "scala-logging_2.12")
exclude("com.typesafe.akka", "akka-stream_2.12")
exclude("com.google.code.findbugs", "jsr305"),
exclude("com.google.code.findbugs", "jsr305")
excludeAll(excludeAkkaHttp, excludeSprayJson),
excludeGuava("org.broadinstitute.dsde.workbench" %% "workbench-util" % "0.3-12b7791-SNAP"),

"com.typesafe.akka" %% "akka-actor" % akkaV,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ object Boot extends App with LazyLogging {
)

for {
_ <- Http().bindAndHandle(service.route, "0.0.0.0", 8080) recover {
_ <- Http().newServerAt( "0.0.0.0", 8080).bind(service.route) recover {
case t: Throwable =>
logger.error("FATAL - failure starting http server", t)
throw t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ object FireCloudConfig {
val whitelists: Set[NihWhitelist] = {
val whitelistConfigs = nih.getConfig("whitelists")

whitelistConfigs.root.asScala.map { case (name, configObject: ConfigObject) =>
whitelistConfigs.root.asScala.collect { case (name, configObject:ConfigObject) =>
val config = configObject.toConfig
val rawlsGroup = config.getString("rawlsGroup")
val fileName = config.getString("fileName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ object PerRequest {
implicit def requestCompleteMarshaller(implicit executionContext: ExecutionContext): ToResponseMarshaller[PerRequestMessage] = Marshaller {
_: ExecutionContext => {
case requestComplete@ RequestComplete(errorReport: ErrorReport) =>
requestComplete.marshaller(requestComplete.response).map(_.map(_.map(_.copy(status = errorReport.statusCode.getOrElse(StatusCodes.InternalServerError)))))
requestComplete.marshaller(requestComplete.response).map(_.map(_.map(_.withStatus(errorReport.statusCode.getOrElse(StatusCodes.InternalServerError)))))
case requestComplete: RequestComplete[_] =>
requestComplete.marshaller(requestComplete.response)

case requestComplete@ RequestCompleteWithHeaders(errorReport: ErrorReport, _) =>
requestComplete.marshaller(requestComplete.response).map(_.map(_.map(_.mapHeaders(_ ++ requestComplete.headers).copy(status = errorReport.statusCode.getOrElse(StatusCodes.InternalServerError)))))
requestComplete.marshaller(requestComplete.response).map(_.map(_.map(_.mapHeaders(_ ++ requestComplete.headers).withStatus(errorReport.statusCode.getOrElse(StatusCodes.InternalServerError)))))
case requestComplete: RequestCompleteWithHeaders[_] =>
requestComplete.marshaller(requestComplete.response).map(_.map(_.map(_.mapHeaders(_ ++ requestComplete.headers))))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package org.broadinstitute.dsde.firecloud.utils

import java.time.Instant

import akka.actor.{ActorRef, ActorSystem}
import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.coding.Gzip
import akka.http.scaladsl.coding._
import akka.http.scaladsl.coding.Coders._
import akka.http.scaladsl.model.headers.{HttpEncodings, `Accept-Encoding`}
import akka.http.scaladsl.model.{HttpRequest, HttpResponse, ResponseEntity}
import akka.http.scaladsl.unmarshalling.{Unmarshal, Unmarshaller}
Expand Down

0 comments on commit 02d25a0

Please sign in to comment.