1
votes

The problem

I'm experimenting with Akka's cluster support. I got stuck with ClusterSingleton support which appears to require JDK8... Which I can't use.

As per documentation here I need to include the following library:

<dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-cluster-tools_2.11</artifactId>
    <version>2.4-SNAPSHOT</version>
</dependency>

As it appears in my tests, the entire akka-*2.11, (compiled with Scala 2.11) requires JDK8, including akka-cluster-tools. I'm not a Scala guy, but it seems quite strange - Scala 2.11.1 release notes suggest, that JDK7 is more than enough:

The Scala 2.11.x series targets Java 6, with (evolving) experimental support for Java 8

Options

What are my options? I see the following:

  1. Drop the idea of using Akka since new releases will require JDK8 as it seems. JDK8 is sadly not an option
  2. Hope there would be akka-cluster-tools_2.10 and my problems disappear. Will there be akka-cluster-tools_2.10?
  3. Forget about akka-cluster-tools_2.10 and use akka-contrib_2.10 instead.
    There's a chance it would work, although
    1. It's going to be more difficult, as the current documentation refers to akka-cluster-tools
    2. I'm just starting with Akka and already need to use deprecated libraries...

Thanks f

1
Akka 2.4 (which isn't released yet) will require Java 8. If you need Java 6/7 support, you'll have to stick with Akka 2.3. - Ryan
You can try 2.3.13 that was released today. - hveiga
@Ryan, thanks for feedback. - featur
@Hvelga, how can 2.3.13 help in this case? - featur

1 Answers

1
votes

As Ryan said in the comment, Akka 2.4 (which isn't yet) requires/will require Java 8.

You can still use ClusterSingleton, Sharding, DistributedPubSub in Akka 2.3 just that it is in the akka-contrib package. And you can find the docs for it under http://doc.akka.io/docs/akka/2.3.12/contrib/index.html so no problems with that.

Additionally the differences in the API:s between 2.3 and 2.4 for the cluster stuff isn't very huge, so it is very much possible to make that move in the future without being too big an effort.

The back side of it might be that improvements to the cluster tools in 2.4 might not necessarily be back ported to 2.3 and that the main development effort will be focused on 2.4 in the future.