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.2.0
JDK versions
Eclipse Temurin JDK 11
Eclipse Temurin JDK 17
Scala versions2.13.12, 3.3.1
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.9.0 or later. See Akka’s Binary Compatibility Rules for details.

The Akka dependencies are available from Akka’s library repository. To access them there, you need to configure the URL for this repository.

sbt
resolvers += "Akka library repository".at("https://repo.akka.io/maven")
Maven
<project>
  ...
  <repositories>
    <repository>
      <id>akka-repository</id>
      <name>Akka library repository</name>
      <url>https://repo.akka.io/maven</url>
    </repository>
  </repositories>
</project>
Gradle
repositories {
    mavenCentral()
    maven {
        url "https://repo.akka.io/maven"
    }
}

Additionally, add the dependencies as below.

sbt
val AkkaVersion = "2.9.0"
libraryDependencies ++= Seq(
  "com.typesafe.akka" %% "akka-persistence-cassandra" % "1.2.0",
  "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.9.0</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.2.0</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.9.0",
  ScalaBinary: "2.13"
]
dependencies {
  implementation "com.typesafe.akka:akka-persistence-cassandra_${versions.ScalaBinary}:1.2.0"
  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.datastax.ossjava-driver-core4.17.0
com.lightbend.akkaakka-stream-alpakka-cassandra_2.137.0.0
com.typesafe.akkaakka-cluster-tools_2.132.9.0
com.typesafe.akkaakka-persistence-query_2.132.9.0
com.typesafe.akkaakka-persistence_2.132.9.0
org.scala-langscala-library2.13.12
Dependency tree
com.datastax.oss    java-driver-core    4.17.0
    com.datastax.oss    java-driver-shaded-guava    25.1-jre-graal-sub-1    Apache 2
    com.datastax.oss    native-protocol    1.5.1    Apache 2
    com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
    com.fasterxml.jackson.core    jackson-databind    2.15.2    The Apache Software License, Version 2.0
        com.fasterxml.jackson.core    jackson-annotations    2.15.2    The Apache Software License, Version 2.0
        com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
    com.github.jnr    jnr-posix    3.1.15    Eclipse Public License - v 2.0
        com.github.jnr    jnr-constants    0.10.3    The Apache Software License, Version 2.0
        com.github.jnr    jnr-ffi    2.2.11    The Apache Software License, Version 2.0
            com.github.jnr    jffi    1.3.9    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    9.2    BSD-3-Clause
                org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
            org.ow2.asm    asm-commons    9.2    BSD-3-Clause
                org.ow2.asm    asm-analysis    9.2    BSD-3-Clause
                    org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                        org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm    9.2    BSD-3-Clause
            org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                org.ow2.asm    asm    9.2    BSD-3-Clause
            org.ow2.asm    asm-util    9.2    BSD-3-Clause
                org.ow2.asm    asm-analysis    9.2    BSD-3-Clause
                    org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                        org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm    9.2    BSD-3-Clause
            org.ow2.asm    asm    9.2    BSD-3-Clause
    com.github.spotbugs    spotbugs-annotations    3.1.12    GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1
        com.google.code.findbugs    jsr305    3.0.2    The Apache Software License, Version 2.0
    com.github.stephenc.jcip    jcip-annotations    1.0-1    Apache License, Version 2.0
    com.typesafe    config    1.4.3    Apache-2.0
    io.dropwizard.metrics    metrics-core    4.1.18
        org.slf4j    slf4j-api    1.7.36
    io.netty    netty-handler    4.1.94.Final
        io.netty    netty-buffer    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
        io.netty    netty-codec    4.1.94.Final
            io.netty    netty-buffer    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
            io.netty    netty-transport    4.1.94.Final
                io.netty    netty-buffer    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
                io.netty    netty-resolver    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
        io.netty    netty-common    4.1.94.Final
        io.netty    netty-resolver    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
        io.netty    netty-transport-native-unix-common    4.1.94.Final
            io.netty    netty-buffer    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
            io.netty    netty-transport    4.1.94.Final
                io.netty    netty-buffer    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
                io.netty    netty-resolver    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
        io.netty    netty-transport    4.1.94.Final
            io.netty    netty-buffer    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
            io.netty    netty-resolver    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
    org.hdrhistogram    HdrHistogram    2.1.12    Public Domain, per Creative Commons CC0
    org.reactivestreams    reactive-streams    1.0.4    MIT-0
    org.slf4j    slf4j-api    1.7.36
com.lightbend.akka    akka-stream-alpakka-cassandra_2.13    7.0.0    BUSL-1.1
    com.datastax.oss    java-driver-core    4.17.0
        com.datastax.oss    java-driver-shaded-guava    25.1-jre-graal-sub-1    Apache 2
        com.datastax.oss    native-protocol    1.5.1    Apache 2
        com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
        com.fasterxml.jackson.core    jackson-databind    2.15.2    The Apache Software License, Version 2.0
            com.fasterxml.jackson.core    jackson-annotations    2.15.2    The Apache Software License, Version 2.0
            com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
        com.github.jnr    jnr-posix    3.1.15    Eclipse Public License - v 2.0
            com.github.jnr    jnr-constants    0.10.3    The Apache Software License, Version 2.0
            com.github.jnr    jnr-ffi    2.2.11    The Apache Software License, Version 2.0
                com.github.jnr    jffi    1.3.9    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    9.2    BSD-3-Clause
                    org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                        org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm-commons    9.2    BSD-3-Clause
                    org.ow2.asm    asm-analysis    9.2    BSD-3-Clause
                        org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                            org.ow2.asm    asm    9.2    BSD-3-Clause
                    org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                        org.ow2.asm    asm    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm-util    9.2    BSD-3-Clause
                    org.ow2.asm    asm-analysis    9.2    BSD-3-Clause
                        org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                            org.ow2.asm    asm    9.2    BSD-3-Clause
                    org.ow2.asm    asm-tree    9.2    BSD-3-Clause
                        org.ow2.asm    asm    9.2    BSD-3-Clause
                    org.ow2.asm    asm    9.2    BSD-3-Clause
                org.ow2.asm    asm    9.2    BSD-3-Clause
        com.github.spotbugs    spotbugs-annotations    3.1.12    GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1
            com.google.code.findbugs    jsr305    3.0.2    The Apache Software License, Version 2.0
        com.github.stephenc.jcip    jcip-annotations    1.0-1    Apache License, Version 2.0
        com.typesafe    config    1.4.3    Apache-2.0
        io.dropwizard.metrics    metrics-core    4.1.18
            org.slf4j    slf4j-api    1.7.36
        io.netty    netty-handler    4.1.94.Final
            io.netty    netty-buffer    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
            io.netty    netty-codec    4.1.94.Final
                io.netty    netty-buffer    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
                io.netty    netty-transport    4.1.94.Final
                    io.netty    netty-buffer    4.1.94.Final
                        io.netty    netty-common    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                    io.netty    netty-resolver    4.1.94.Final
                        io.netty    netty-common    4.1.94.Final
            io.netty    netty-common    4.1.94.Final
            io.netty    netty-resolver    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
            io.netty    netty-transport-native-unix-common    4.1.94.Final
                io.netty    netty-buffer    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
                io.netty    netty-transport    4.1.94.Final
                    io.netty    netty-buffer    4.1.94.Final
                        io.netty    netty-common    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                    io.netty    netty-resolver    4.1.94.Final
                        io.netty    netty-common    4.1.94.Final
            io.netty    netty-transport    4.1.94.Final
                io.netty    netty-buffer    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
                io.netty    netty-common    4.1.94.Final
                io.netty    netty-resolver    4.1.94.Final
                    io.netty    netty-common    4.1.94.Final
        org.hdrhistogram    HdrHistogram    2.1.12    Public Domain, per Creative Commons CC0
        org.reactivestreams    reactive-streams    1.0.4    MIT-0
        org.slf4j    slf4j-api    1.7.36
    com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
    com.fasterxml.jackson.core    jackson-databind    2.15.2    The Apache Software License, Version 2.0
        com.fasterxml.jackson.core    jackson-annotations    2.15.2    The Apache Software License, Version 2.0
        com.fasterxml.jackson.core    jackson-core    2.15.2    The Apache Software License, Version 2.0
    com.typesafe.akka    akka-stream_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
            com.typesafe    config    1.4.3    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
        org.reactivestreams    reactive-streams    1.0.4    MIT-0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    org.scala-lang    scala-library    2.13.12    Apache-2.0
com.typesafe.akka    akka-cluster-tools_2.13    2.9.0    BUSL-1.1
    com.typesafe.akka    akka-cluster_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-coordination_2.13    2.9.0    BUSL-1.1
            com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
                com.typesafe    config    1.4.3    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                    org.scala-lang    scala-library    2.13.12    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        com.typesafe.akka    akka-remote_2.13    2.9.0    BUSL-1.1
            com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
                com.typesafe    config    1.4.3    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                    org.scala-lang    scala-library    2.13.12    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            com.typesafe.akka    akka-pki_2.13    2.9.0    BUSL-1.1
                com.hierynomus    asn-one    0.6.0    The Apache License, Version 2.0
                com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
                    com.typesafe    config    1.4.3    Apache-2.0
                    org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                        org.scala-lang    scala-library    2.13.12    Apache-2.0
                    org.scala-lang    scala-library    2.13.12    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
                org.slf4j    slf4j-api    1.7.36
            com.typesafe.akka    akka-stream_2.13    2.9.0    BUSL-1.1
                com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
                    com.typesafe    config    1.4.3    Apache-2.0
                    org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                        org.scala-lang    scala-library    2.13.12    Apache-2.0
                    org.scala-lang    scala-library    2.13.12    Apache-2.0
                com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
                org.reactivestreams    reactive-streams    1.0.4    MIT-0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.agrona    agrona    1.19.2    The Apache License, Version 2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    com.typesafe.akka    akka-coordination_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
            com.typesafe    config    1.4.3    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    org.scala-lang    scala-library    2.13.12    Apache-2.0
com.typesafe.akka    akka-persistence-query_2.13    2.9.0    BUSL-1.1
    com.typesafe.akka    akka-persistence_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
            com.typesafe    config    1.4.3    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        com.typesafe.akka    akka-stream_2.13    2.9.0    BUSL-1.1
            com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
                com.typesafe    config    1.4.3    Apache-2.0
                org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                    org.scala-lang    scala-library    2.13.12    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
            org.reactivestreams    reactive-streams    1.0.4    MIT-0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
    com.typesafe.akka    akka-stream_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
            com.typesafe    config    1.4.3    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
        org.reactivestreams    reactive-streams    1.0.4    MIT-0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    org.scala-lang    scala-library    2.13.12    Apache-2.0
com.typesafe.akka    akka-persistence_2.13    2.9.0    BUSL-1.1
    com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
        com.typesafe    config    1.4.3    Apache-2.0
        org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    com.typesafe.akka    akka-stream_2.13    2.9.0    BUSL-1.1
        com.typesafe.akka    akka-actor_2.13    2.9.0    BUSL-1.1
            com.typesafe    config    1.4.3    Apache-2.0
            org.scala-lang.modules    scala-java8-compat_2.13    1.0.2    Apache-2.0
                org.scala-lang    scala-library    2.13.12    Apache-2.0
            org.scala-lang    scala-library    2.13.12    Apache-2.0
        com.typesafe.akka    akka-protobuf-v3_2.13    2.9.0    BUSL-1.1
        org.reactivestreams    reactive-streams    1.0.4    MIT-0
        org.scala-lang    scala-library    2.13.12    Apache-2.0
    org.scala-lang    scala-library    2.13.12    Apache-2.0
org.scala-lang    scala-library    2.13.12    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.

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.