1

I have an HTTP Backend with Scala Play. Works fine. Now I want to set up a gRPC-API on top of it (theoretical this should work).

To set gRPC up I basically followed the akka-quickstart

I can run sbt compile and get my generated Scala classes in the target/../ dic. But if I try to run sbt run I get

--- (Running the application, auto-reloading is enabled) ---

[warn] a.u.ManifestInfo - You are using version 2.6.5 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.5 of the [akka-discovery] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
[error] java.lang.IllegalStateException: You are using version 2.6.5 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.5 of the [akka-discovery] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed

So I understand that some libs I use, are too old for Akka 2.6.5 but i don't understand how to set my service on a lower Akka version.

My plugins.sbt

addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.8.2")
addSbtPlugin("org.foundweekends.giter8" % "sbt-giter8-scaffold" % "0.11.0")
addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "1.0.0-M1")
resolvers += Resolver.bintrayRepo("playframework", "maven")
libraryDependencies += "com.lightbend.play" %% "play-grpc-generators" % "0.8.2"

my build.sbt


name := "smartmarkt"
version := "1.0-SNAPSHOT"
scalaVersion := "2.13.2"

lazy val root = (project in file("."))
  .enablePlugins(PlayScala, PlayAkkaHttp2Support, AkkaGrpcPlugin)

import play.grpc.gen.scaladsl.PlayScalaServerCodeGenerator
akkaGrpcExtraGenerators += PlayScalaServerCodeGenerator
libraryDependencies += "com.lightbend.play" %% "play-grpc-runtime" % "0.8.2"

libraryDependencies += guice
libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test
Proxy
  • 41
  • 1
  • 6

1 Answers1

2

Looking at your direct dependencies:

"com.lightbend.play" %% "play-grpc-runtime" % "0.8.2" depends on akka-discovery 2.6.4.

You are using Play 2.8.2 which depends on Akka version 2.6.5.

Just add the depencency on akka-discovery 2.6.5 to your dependencies:

libraryDependencies += "com.typesafe.akka" %% "akka-discovery" % "2.6.5"
cbley
  • 4,538
  • 1
  • 17
  • 32