Search code examples
scalaakkaakka-persistence

Disabling journal in AKKA persistence


I'm doing a performance test to an AKKA persistent actor and I want to know the impact writing to the journal.

Simple question but I did not find anything in the documentation:

How to disable the journal from the config file? I'm looking for something like a mock or null journal plugin.

Any idea?


Solution

  • I created a project with a persistence plugin (journal + snapshots) that basically does not do anything but ignoring.

    Of course, using this plugin will not recover after a failure, so your system will not be resilient.

    This is the project: https://github.com/angelcervera/akka-persistence-nowhere

    How to use it:

    1. Import or add in the classpath
    resolvers += "osm4scala repo" at "http://dl.bintray.com/angelcervera/maven" // If 
    it's not found in the main maven repository. 
    libraryDependencies += "com.acervera.akka" %% "akka-persistence-nowhere" % "1.0.1"
    
    1. Overwriting your default application.conf
    akka {
      persistence {
        journal.plugin = "disable-journal-store"
        snapshot-store.plugin = "disable-snapshot-store"
      }
    }
    
    disable-journal-store {
      class = "com.acervera.akka.persistence.nowhere.AkkaPersistenceNowhereJournal"
      plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
    }
    
    disable-snapshot-store {
      class = "com.acervera.akka.persistence.nowhere.AkkaPersistenceNowhereSnapshotStore"
      plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
    }