Skip to content

Commit

Permalink
bump: Akka 2.9.7, grpc 1.4.4 (#2227)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriknw authored Oct 24, 2024
1 parent 97abcdb commit 3b644ef
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 11 deletions.
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ object Dependencies {
val Scala3Version = "3.3.3"
val CrossScalaVersions = Seq(ScalaVersion, Scala3Version)

val ProtobufVersion = // akka.grpc.gen.BuildInfo.googleProtobufVersion
"3.21.12" // explicitly overriding the 3.21.1 version from Akka gRPC 2.1.6 (even though its build says 3.20.1)
val ProtobufVersion = akka.grpc.gen.BuildInfo.googleProtobufVersion

val AkkaVersion = "2.9.3"
val AkkaVersion = "2.9.7"
val AkkaHttpVersion = "10.6.3" // Note: should at least the Akka HTTP version required by Akka gRPC
val ScalaTestVersion = "3.2.14"
// https://github.com/akka/akka/blob/main/project/Dependencies.scala#L31
Expand Down Expand Up @@ -97,6 +96,7 @@ object Dependencies {
akkaDependency("akka-stream"),
akkaDependency("akka-slf4j"),
akkaDependency("akka-discovery"),
akkaDependency("akka-pki"),
akkaHttpDependency("akka-http"),
akkaHttpDependency("akka-http-core"),
akkaHttpDependency("akka-http-spray-json"),
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolvers += "Akka library repository".at("https://repo.akka.io/maven")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.16")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1")
// even updated `akka-grpc.version` in pom.xml files
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.3")
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.4")
addSbtPlugin("com.lightbend.sbt" % "sbt-java-formatter" % "0.7.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sys.props.get("plugin.version") match {
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.4") // FIXME should be included via sbt-kalix
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.4") // FIXME should be included via sbt-kalix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sys.props.get("plugin.version") match {
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.4") // FIXME should be included via sbt-kalix
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.4") // FIXME should be included via sbt-kalix
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ sys.props.get("plugin.version") match {
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.1.4") // FIXME should be included via sbt-kalix
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "2.4.4") // FIXME should be included via sbt-kalix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (C) 2021-2024 Lightbend Inc. <https://www.lightbend.com>
*/

package kalix.javasdk;

import akka.actor.dungeon.LicenseKeySupplier;
import com.typesafe.config.Config;

import java.util.function.Supplier;

/**
* INTERNAL API: Written in Java to be package private
*/
class KalixRunnerLicenseKeySupplier implements LicenseKeySupplier {

@Override
public void implementing_this_is_a_violation_of_the_akka_license() {
}

@Override
public String get(Config config) {
return "3CecWl2eB9O9eHXVjfZjhSA55GSJTudOl8i8gTiPFDLe8MmzU0iPH8V8Ma8kQNmhpu8hzdTesrFa0931MAKNJevZAJimVbQrzDo9CWJ2wgRHAQA55EZrp0OFH8hurn17aPStA57p49suFWd48w8jIeWhzJ47FZPc9wheI9HBORPDdFch8XvogD3tTEJEeaPupCcmizJ27qz0AGSMtD73BuqmRF8sIHWvNAhoMGN4vTabIGi4r";
}

<A> A aroundActorSystemCreation(Supplier<A> creator) {
LicenseKeySupplier.instance().set(this);
try {
return creator.get();
} finally {
LicenseKeySupplier.instance().set(null); // clear ThreadLocal
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,21 @@ final class KalixRunner private[javasdk] (
* Creates a KalixRunner from the given services. Use the default config to create the internal ActorSystem.
*/
def this(services: java.util.Map[String, java.util.function.Function[ActorSystem, Service]], sdkName: String) = {
this(ActorSystem("kalix", KalixRunner.loadPreparedConfig()), services.asScala.toMap, aclDescriptor = None, sdkName)
this(
(new KalixRunnerLicenseKeySupplier).aroundActorSystemCreation(() =>
ActorSystem("kalix", KalixRunner.loadPreparedConfig())),
services.asScala.toMap,
aclDescriptor = None,
sdkName)
}

def this(
services: java.util.Map[String, java.util.function.Function[ActorSystem, Service]],
aclDescriptor: Option[FileDescriptorProto],
sdkName: String) =
this(
ActorSystem("kalix", KalixRunner.loadPreparedConfig()),
(new KalixRunnerLicenseKeySupplier).aroundActorSystemCreation(() =>
ActorSystem("kalix", KalixRunner.loadPreparedConfig())),
services.asScala.toMap,
aclDescriptor = aclDescriptor,
sdkName)
Expand All @@ -137,15 +143,21 @@ final class KalixRunner private[javasdk] (
services: java.util.Map[String, java.util.function.Function[ActorSystem, Service]],
config: Config,
sdkName: String) =
this(ActorSystem("kalix", KalixRunner.prepareConfig(config)), services.asScala.toMap, aclDescriptor = None, sdkName)
this(
(new KalixRunnerLicenseKeySupplier).aroundActorSystemCreation(() =>
ActorSystem("kalix", KalixRunner.prepareConfig(config))),
services.asScala.toMap,
aclDescriptor = None,
sdkName)

def this(
services: java.util.Map[String, java.util.function.Function[ActorSystem, Service]],
config: Config,
aclDescriptor: Option[FileDescriptorProto],
sdkName: String) =
this(
ActorSystem("kalix", KalixRunner.prepareConfig(config)),
(new KalixRunnerLicenseKeySupplier).aroundActorSystemCreation(() =>
ActorSystem("kalix", KalixRunner.prepareConfig(config))),
services.asScala.toMap,
aclDescriptor = aclDescriptor,
sdkName)
Expand Down

0 comments on commit 3b644ef

Please sign in to comment.