GithubHelp home page GithubHelp logo

akka-persistence-redis's Introduction

#Akka Persistence Redis Plugin

What is Akka Persistence Redis plugin?

This is a plugin for Akka Persistence that uses Redis as backend.

Compatibility

This plugin was developed for Akka 2.3.x and Scala 2.11.x It uses rediscala, an asynchronous Redis client written with Akka and Scala. Deprecated methods since Akka 2.3.4 are NOT implemented. As a result, some tests in TCK fail. Rest of methods are tested with the test harness included in this project.

Quick start guide

Installation

build.sbt

resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscala
libraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.2.1")

Activation

akka.persistence.journal.plugin = "akka-persistence-redis.journal"
akka.persistence.snapshot-store.plugin = "akka-persistence-redis.snapshot"

Redis config

From rediscala

redis {
  host = "localhost"
  port = 6379
}

Usage

Redis keys

Journal and snapshot use "journal:" and "snapshot:" as part of keys respectively as it is a good practice to create namespace for keys reference

How is data stored in Redis?

In order to enforce ordering, journal entries and snapshots are inserted into Sorted Set and sorted by sequenceNr

Using custom ExecutionContext

By default, global ExecutionContext is used for Redis operation. This blocks calling thread for synchronous Akka Persistence APIs. Override JournalExecutionContext trait to use custom thread pool if blocking in global is undesirable.

trait CustomExecutionContext extends JournalExecutionContext {
  override implicit val ec: ExecutionContext = ExecutionContext.fromExecutorService(Executors.newSingleThreadExecutor())
}

How to contribute

Contribute by submitting a PR and a bug report in GitHub.

Maintainer

Steve Song @ssongvan

akka-persistence-redis's People

Contributors

robfletcher avatar ssong-van avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.