Overview

The Akka Persistence Cassandra plugin allows for using Apache Cassandra as a backend for Akka Persistence and Akka Persistence Query. It uses Alpakka Cassandra for Cassandra access which is based on the Datastax Java Driver.

Project Info

Project Info: Akka Persistence Cassandra
Artifact
com.typesafe.akka
akka-persistence-cassandra
1.0.6
JDK versions
Adopt OpenJDK 8
Adopt OpenJDK 11
Scala versions2.12.16, 2.13.8
JPMS module nameakka.persistence.cassandra
License
Readiness level
Since 1.0.0, 2020-04-30
Home pagehttps://akka.io
API documentation
Forums
Release notesGitHub releases
IssuesGitHub issues
Sourceshttps://github.com/akka/akka-persistence-cassandra

Dependencies

This plugin requires Akka 2.6.9 or later. See Akka’s Binary Compatibility Rules for details.

sbt
val AkkaVersion = "2.6.9"
libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-persistence-cassandra" % "1.0.6",
  "com.typesafe.akka" %% "akka-persistence" % AkkaVersion,
  "com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion,
  "com.typesafe.akka" %% "akka-cluster-tools" % AkkaVersion
)
Maven
<properties>
  <akka.version>2.6.9</akka.version>
  <scala.binary.version>2.13</scala.binary.version>
</properties>
<dependencies>
  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-persistence-cassandra_${scala.binary.version}</artifactId>
    <version>1.0.6</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-persistence_${scala.binary.version}</artifactId>
    <version>${akka.version}</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-persistence-query_${scala.binary.version}</artifactId>
    <version>${akka.version}</version>
  </dependency>
  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-cluster-tools_${scala.binary.version}</artifactId>
    <version>${akka.version}</version>
  </dependency>
</dependencies>
Gradle
def versions = [
  AkkaVersion: "2.6.9",
  ScalaBinary: "2.13"
]
dependencies {
  implementation "com.typesafe.akka:akka-persistence-cassandra_${versions.ScalaBinary}:1.0.6"
  implementation "com.typesafe.akka:akka-persistence_${versions.ScalaBinary}:${versions.AkkaVersion}"
  implementation "com.typesafe.akka:akka-persistence-query_${versions.ScalaBinary}:${versions.AkkaVersion}"
  implementation "com.typesafe.akka:akka-cluster-tools_${versions.ScalaBinary}:${versions.AkkaVersion}"
}

Note that it is important that all akka-* dependencies are in the same version, so it is recommended to depend on them explicitly to avoid problems with transient dependencies causing an unlucky mix of versions.

The table below shows Akka Persistence Cassandra’s direct dependencies and the second tab shows all libraries it depends on transitively.

Direct dependencies
OrganizationArtifactVersion
com.lightbend.akkaakka-stream-alpakka-cassandra_2.132.0.2
com.typesafe.akkaakka-cluster-tools_2.132.6.9
com.typesafe.akkaakka-persistence-query_2.132.6.9
com.typesafe.akkaakka-persistence_2.132.6.9
org.scala-lang.modulesscala-collection-compat_2.132.4.4
org.scala-langscala-library2.13.8
Dependency tree
com.lightbend.akka    akka-stream-alpakka-cassandra_2.13    2.0.2    Apache-2.0
    com.datastax.oss    java-driver-core    4.6.1
        com.datastax.oss    java-driver-shaded-guava    25.1-jre    Apache 2
        com.datastax.oss    native-protocol    1.4.10    Apache 2
        com.fasterxml.jackson.core    jackson-core    2.10.5
        com.fasterxml.jackson.core    jackson-databind    2.10.5
            com.fasterxml.jackson.core    jackson-annotations    2.10.5
            com.fasterxml.jackson.core    jackson-core    2.10.5
        com.github.jnr    jnr-posix    3.0.50    Eclipse Public License - v 2.0
            com.github.jnr    jnr-constants    0.9.12    The Apache Software License, Version 2.0
            com.github.jnr    jnr-ffi    2.1.10    The Apache Software License, Version 2.0
                com.github.jnr    jffi    1.2.19    The Apache Software License, Version 2.0
                com.github.jnr    jnr-a64asm    1.0.0    The Apache Software License, Version 2.0
                com.github.jnr    jnr-x86asm    1.0.2    MIT License
                org.ow2.asm    asm-analysis    7.1    BSD
                    org.ow2.asm    asm-tree    7.1    BSD
                        org.ow2.asm    asm    7.1    BSD
                org.ow2.asm    asm-commons    7.1    BSD
                    org.ow2.asm    asm-analysis    7.1    BSD
                        org.ow2.asm    asm-tree    7.1    BSD
                            org.ow2.asm    asm    7.1    BSD
                    org.ow2.asm    asm-tree    7.1    BSD
                        org.ow2.asm    asm    7.1    BSD
                    org.ow2.asm    asm    7.1    BSD
                org.ow2.asm    asm-tree    7.1    BSD
                    org.ow2.asm    asm    7.1    BSD
                org.ow2.asm    asm-util    7.1    BSD
                    org.ow2.asm    asm-analysis    7.1    BSD
                        org.ow2.asm    asm-tree    7.1    BSD
                            org.ow2.asm    asm    7.1    BSD
                    org.ow2.asm    asm-tree    7.1    BSD
                        org.ow2.asm    asm    7.1    BSD
                    org.ow2.asm    asm    7.1    BSD
                org.ow2.asm    asm    7.1    BSD
        com.github.stephenc.jcip    jcip-annotations    1.0-1    Apache License, Version 2.0
        com.typesafe    config    1.4.0    Apache-2.0
        io.dropwizard.metrics    metrics-core    4.0.5
            org.slf4j    slf4j-api    1.7.30
        io.netty    netty-handler    4.1.52.Final
            io.netty    netty-buffer    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
            io.netty    netty-codec    4.1.52.Final
                io.netty    netty-buffer    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
                io.netty    netty-transport    4.1.52.Final
                    io.netty    netty-buffer    4.1.52.Final
                        io.netty    netty-common    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
                    io.netty    netty-resolver    4.1.52.Final
                        io.netty    netty-common    4.1.52.Final
            io.netty    netty-common    4.1.52.Final
            io.netty    netty-resolver    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
            io.netty    netty-transport    4.1.52.Final
                io.netty    netty-buffer    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
                io.netty    netty-resolver    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
        org.hdrhistogram    HdrHistogram    2.1.11    Public Domain, per Creative Commons CC0
        org.javatuples    javatuples    1.2    The Apache Software License, Version 2.0
        org.reactivestreams    reactive-streams    1.0.3    CC0
        org.slf4j    slf4j-api    1.7.30
    com.fasterxml.jackson.core    jackson-core    2.10.5
    com.fasterxml.jackson.core    jackson-databind    2.10.5
        com.fasterxml.jackson.core    jackson-annotations    2.10.5
        com.fasterxml.jackson.core    jackson-core    2.10.5
    com.typesafe.akka    akka-stream_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.6.9    Apache-2.0
        com.typesafe    ssl-config-core_2.13    0.4.2    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-parser-combinators_2.13    1.1.2    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.reactivestreams    reactive-streams    1.0.3    CC0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    io.netty    netty-handler    4.1.52.Final
        io.netty    netty-buffer    4.1.52.Final
            io.netty    netty-common    4.1.52.Final
        io.netty    netty-codec    4.1.52.Final
            io.netty    netty-buffer    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
            io.netty    netty-common    4.1.52.Final
            io.netty    netty-transport    4.1.52.Final
                io.netty    netty-buffer    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
                io.netty    netty-resolver    4.1.52.Final
                    io.netty    netty-common    4.1.52.Final
        io.netty    netty-common    4.1.52.Final
        io.netty    netty-resolver    4.1.52.Final
            io.netty    netty-common    4.1.52.Final
        io.netty    netty-transport    4.1.52.Final
            io.netty    netty-buffer    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
            io.netty    netty-common    4.1.52.Final
            io.netty    netty-resolver    4.1.52.Final
                io.netty    netty-common    4.1.52.Final
    org.scala-lang    scala-library    2.13.8    Apache-2.0
com.typesafe.akka    akka-cluster-tools_2.13    2.6.9    Apache-2.0
    com.typesafe.akka    akka-cluster_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-coordination_2.13    2.6.9    Apache-2.0
            com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
                com.typesafe    config    1.4.0    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        com.typesafe.akka    akka-remote_2.13    2.6.9    Apache-2.0
            com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
                com.typesafe    config    1.4.0    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            com.typesafe.akka    akka-pki_2.13    2.6.9    Apache-2.0
                com.hierynomus    asn-one    0.4.0    Apache License 2.0
                com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
                    com.typesafe    config    1.4.0    Apache-2.0
                    org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                        org.scala-lang    scala-library    2.13.8    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.slf4j    slf4j-api    1.7.30
            com.typesafe.akka    akka-stream_2.13    2.6.9    Apache-2.0
                com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
                    com.typesafe    config    1.4.0    Apache-2.0
                    org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                        org.scala-lang    scala-library    2.13.8    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                com.typesafe.akka    akka-protobuf-v3_2.13    2.6.9    Apache-2.0
                com.typesafe    ssl-config-core_2.13    0.4.2    Apache-2.0
                    com.typesafe    config    1.4.0    Apache-2.0
                    org.scala-lang.modules    scala-parser-combinators_2.13    1.1.2    Apache-2.0
                        org.scala-lang    scala-library    2.13.8    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.reactivestreams    reactive-streams    1.0.3    CC0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.agrona    agrona    1.4.1    The Apache License, Version 2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    com.typesafe.akka    akka-coordination_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    org.scala-lang    scala-library    2.13.8    Apache-2.0
com.typesafe.akka    akka-persistence-query_2.13    2.6.9    Apache-2.0
    com.typesafe.akka    akka-persistence_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        com.typesafe.akka    akka-stream_2.13    2.6.9    Apache-2.0
            com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
                com.typesafe    config    1.4.0    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            com.typesafe.akka    akka-protobuf-v3_2.13    2.6.9    Apache-2.0
            com.typesafe    ssl-config-core_2.13    0.4.2    Apache-2.0
                com.typesafe    config    1.4.0    Apache-2.0
                org.scala-lang.modules    scala-parser-combinators_2.13    1.1.2    Apache-2.0
                    org.scala-lang    scala-library    2.13.8    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.reactivestreams    reactive-streams    1.0.3    CC0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    com.typesafe.akka    akka-stream_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.6.9    Apache-2.0
        com.typesafe    ssl-config-core_2.13    0.4.2    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-parser-combinators_2.13    1.1.2    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.reactivestreams    reactive-streams    1.0.3    CC0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    org.scala-lang    scala-library    2.13.8    Apache-2.0
com.typesafe.akka    akka-persistence_2.13    2.6.9    Apache-2.0
    com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
        com.typesafe    config    1.4.0    Apache-2.0
        org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    com.typesafe.akka    akka-stream_2.13    2.6.9    Apache-2.0
        com.typesafe.akka    akka-actor_2.13    2.6.9    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    0.9.0    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.6.9    Apache-2.0
        com.typesafe    ssl-config-core_2.13    0.4.2    Apache-2.0
            com.typesafe    config    1.4.0    Apache-2.0
            org.scala-lang.modules    scala-parser-combinators_2.13    1.1.2    Apache-2.0
                org.scala-lang    scala-library    2.13.8    Apache-2.0
            org.scala-lang    scala-library    2.13.8    Apache-2.0
        org.reactivestreams    reactive-streams    1.0.3    CC0
        org.scala-lang    scala-library    2.13.8    Apache-2.0
    org.scala-lang    scala-library    2.13.8    Apache-2.0
org.scala-lang.modules    scala-collection-compat_2.13    2.4.4    Apache-2.0
    org.scala-lang    scala-library    2.13.8    Apache-2.0
org.scala-lang    scala-library    2.13.8    Apache-2.0

To use the plugin with Akka 2.5.x you must use version 0.103 or later in the 0.x series.

Snapshots

Snapshots are published to a snapshot repository in Sonatype after every successful build on master. Add the following to your project build definition to resolve snapshots:

sbt
resolvers += Resolver.bintrayRepo("akka", "snapshots")
Maven
<project>
...
  <repositories>
    <repository>
      <id>akka-snapshots</id>
      <name>Akka Snapshots</name>
      <url>https://dl.bintray.com/akka/snapshots</url>
    </repository>
  </repositories>
...
</project>
Gradle
repositories {
  maven {
    url  "https://dl.bintray.com/akka/snapshots"
  }
}

Latest published snapshot version is bintray-badge

The snapshot documentation is updated with every snapshot build.

History

This Apache Cassandra plugin to Akka Persistence was initiated originally by Martin Krasser, @krasserm in 2014.

It moved to the Akka organisation in 2016 and the first release after that move was 0.7 in January 2016.

Contributing

Please feel free to contribute to Akka and Akka Persistence Cassandra by reporting issues you identify, or by suggesting changes to the code. Please refer to our contributing instructions to learn how it can be done.

We want Akka to strive in a welcoming and open atmosphere and expect all contributors to respect our code of conduct.

Found an error in this documentation? The source code for this page can be found here. Please feel free to edit and contribute a pull request.