From 30c90a42b8968fd62f9529c556e2a1e06ac0e446 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Tue, 26 Nov 2024 12:45:25 +0000 Subject: [PATCH 1/2] fix thrall kinesis client in dev --- thrall/app/lib/ThrallConfig.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/thrall/app/lib/ThrallConfig.scala b/thrall/app/lib/ThrallConfig.scala index b98a804b69..a5eeab49d8 100644 --- a/thrall/app/lib/ThrallConfig.scala +++ b/thrall/app/lib/ThrallConfig.scala @@ -8,6 +8,8 @@ import org.joda.time.DateTime import org.joda.time.format.ISODateTimeFormat import play.api.inject.ApplicationLifecycle import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider +import software.amazon.awssdk.http.Protocol +import software.amazon.awssdk.http.nio.netty.NettyNioAsyncHttpClient import software.amazon.awssdk.regions.Region import software.amazon.awssdk.services.cloudwatch.{CloudWatchAsyncClient, CloudWatchAsyncClientBuilder} import software.amazon.awssdk.services.dynamodb.{DynamoDbAsyncClient, DynamoDbAsyncClientBuilder} @@ -27,7 +29,15 @@ case class KinesisReceiverConfig( rewindFrom: Option[DateTime], metricsLevel: MetricsLevel = MetricsLevel.DETAILED ) extends AwsClientV2BuilderUtils { - lazy val kinesisClient: KinesisAsyncClient = withAWSCredentialsV2(KinesisAsyncClient.builder()).build() + lazy val kinesisClient: KinesisAsyncClient = { + val clientBuilder = withAWSCredentialsV2(KinesisAsyncClient.builder()) + if (isDev) { + clientBuilder.httpClientBuilder(NettyNioAsyncHttpClient + .builder() + .protocol(Protocol.HTTP1_1)) + } + clientBuilder.build() + } lazy val dynamoClient: DynamoDbAsyncClient = withAWSCredentialsV2(DynamoDbAsyncClient.builder()).build() lazy val cloudwatchClient: CloudWatchAsyncClient = withAWSCredentialsV2(CloudWatchAsyncClient.builder()).build() } From 853b0dc5c154e2e8edfda828798a7ea70d3e1f68 Mon Sep 17 00:00:00 2001 From: Andrew Nowak Date: Tue, 26 Nov 2024 12:45:37 +0000 Subject: [PATCH 2/2] play 2.9 migration --- build.sbt | 14 +++++++------- project/plugins.sbt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index 9a74b9c345..5c7b4963eb 100644 --- a/build.sbt +++ b/build.sbt @@ -35,7 +35,7 @@ val commonSettings = Seq( Test / testOptions ++= Seq(Tests.Argument(TestFrameworks.ScalaTest, "-o"), Tests.Argument(TestFrameworks.ScalaTest, "-u", "logs/test-reports")), libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.2.19" % Test, - "org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test, + "org.scalatestplus.play" %% "scalatestplus-play" % "6.0.1" % Test, "org.scalatestplus" %% "mockito-3-4" % "3.1.4.0" % Test, "org.mockito" % "mockito-core" % "2.18.0" % Test, "org.scalamock" %% "scalamock" % "5.1.0" % Test, @@ -76,7 +76,7 @@ val maybeBBCLib: Option[sbt.ProjectReference] = if(bbcBuildProcess) Some(bbcProj lazy val commonLib = project("common-lib").settings( libraryDependencies ++= Seq( "com.gu" %% "editorial-permissions-client" % "3.0.0", - "com.gu" %% "pan-domain-auth-play_2-8" % "7.0.0", + "com.gu" %% "pan-domain-auth-play_2-9" % "7.0.0", "com.amazonaws" % "aws-java-sdk-iam" % awsSdkVersion, "com.amazonaws" % "aws-java-sdk-s3" % awsSdkVersion, "com.amazonaws" % "aws-java-sdk-ec2" % awsSdkVersion, @@ -95,7 +95,7 @@ lazy val commonLib = project("common-lib").settings( "org.im4java" % "im4java" % "1.4.0", "com.gu" % "kinesis-logback-appender" % "1.4.4", "net.logstash.logback" % "logstash-logback-encoder" % "5.0", - "com.typesafe.play" %% "play-logback" % "2.8.20", // needed when running the scripts + logback, // play-logback; needed when running the scripts "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2", "org.scalacheck" %% "scalacheck" % "1.14.0", "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2", @@ -103,10 +103,10 @@ lazy val commonLib = project("common-lib").settings( // i.e. to only log to disk in DEV // see: https://logback.qos.ch/setup.html#janino "org.codehaus.janino" % "janino" % "3.0.6", - "com.typesafe.play" %% "play-json-joda" % "2.9.2", + "com.typesafe.play" %% "play-json-joda" % "2.10.2", "org.scanamo" %% "scanamo" % "2.0.0", // Necessary to have a mix of play library versions due to scala-java8-compat incompatibility - "com.typesafe.play" %% "play-ahc-ws" % "2.8.9", + ws, "org.yaml" % "snakeyaml" % "1.31", "org.testcontainers" % "elasticsearch" % "1.19.2" % Test ), @@ -115,8 +115,8 @@ lazy val commonLib = project("common-lib").settings( lazy val restLib = project("rest-lib").settings( libraryDependencies ++= Seq( - "com.typesafe.play" %% "play" % "2.8.20", - "com.typesafe.play" %% "filters-helpers" % "2.8.11", + playCore, + filters, akkaHttpServer, ), ).dependsOn(commonLib % "compile->compile;test->test") diff --git a/project/plugins.sbt b/project/plugins.sbt index 44b36aadb6..0a983577d9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar")) -addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.20") +addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.5") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")