Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Akka version collision between Flink and Play 2.5

In our project we have a Flink (1.1.3) streaming job that reads from one kafka queue, performs a map function transformation and writes to another queue.

This was working well until we introduced an outgoing REST request as part of the flow. To do this we used the PlayFramework WSClient (as it is used in other places of our stack), and created it in the code in this way:

  val config = new AhcWSClientConfig(wsClientConfig = WSClientConfig())
  val builder = new AhcConfigBuilder(config)
  val ahcConfig = builder.configure().build()
  new AhcWSClient(ahcConfig)(ActorMaterializer()(ActorSystem()))

This worked well locally, but when deploying it and running on a cluster, I got this exception:

java.lang.NoSuchMethodError: akka.util.Helpers$.toRootLowerCase(Ljava/lang/String;)Ljava/lang/String;
    at akka.stream.StreamSubscriptionTimeoutSettings$.apply(ActorMaterializer.scala:491)
    at akka.stream.ActorMaterializerSettings$.apply(ActorMaterializer.scala:243)
    at akka.stream.ActorMaterializerSettings$.apply(ActorMaterializer.scala:232)
    at akka.stream.ActorMaterializer$$anonfun$1.apply(ActorMaterializer.scala:41)
    at akka.stream.ActorMaterializer$$anonfun$1.apply(ActorMaterializer.scala:41)
    at scala.Option.getOrElse(Option.scala:121)
    at akka.stream.ActorMaterializer$.apply(ActorMaterializer.scala:41)
    at com.ourstuff.etl.core.utils.web.GlobalWSClient$.generateClient(WSClientFactory.scala:32)

Investigating into it, I assumed this is a collision between Akka 2.3.x (brought by Flink 1.1.X) and Akka 2.4.x (brought by PlayFramework).

We upgraded the Flink cluster to 1.3.1 (as well as our code's dependency on Flink), assuming this will solve the issue. But the same issue seems to persist.

Any idea on what might still be causing this?

like image 810
JoefGoldstein Avatar asked Jul 25 '17 08:07

JoefGoldstein


People also ask

What is the difference between Akka and Play Framework?

Akka is a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM. On the other hand, Play is detailed as "The High Velocity Web Framework For Java and Scala". Play Framework makes it easy to build web applications with Java & Scala.

When will the Akka version be patched?

Only patched if critical bugs are found. Artifacts are available from Maven Central. Akka 2.4 reached end-of-life 12/31/2017, with the last version being 2.4.20 Artifacts are available from Maven Central. Akka 2.3 reached end-of-life April, 2017 with the last version being 2.3.16. Artifacts are available from Maven Central.

What is the current stable version of Akka?

For current stable release (2.6.17) check the documentation page. Akka 2.5 was the previous stable version. Only patched if critical bugs are found. Artifacts are available from Maven Central. Akka 2.4 reached end-of-life 12/31/2017, with the last version being 2.4.20


1 Answers

The only way to resolve this dependency conflict is by relocating the conflicting classes into a different namespace.

like image 180
Robert Metzger Avatar answered Sep 22 '22 08:09

Robert Metzger