• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    Scala
  • License
    Other
  • Created about 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Akka Persistence that uses Redis as backend

No longer actively maintained

Akka Persistence Redis Plugin

What is Akka Persistence Redis plugin?

This is a plugin for Akka Persistence that uses Redis as backend. It uses rediscala, an asynchronous Redis client written with Akka and Scala. It also depends on play-json for JSON serialization.

Compatibility

Scala 2.12 and Akka 2.5.x

Use versions from 0.9.0

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

Scala 2.12 and Akka 2.4.x

Use versions from 0.7.0

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

Scala 2.11, Akka 2.4.x and Play 2.5.x

Use 0.6.0

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

Scala 2.11, Akka 2.4.x and Play 2.4.x

Use 0.5.0

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

Scala 2.11 and Akka 2.3.x

Use 0.2.2

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

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.

SNAPSHOT

Development snapshots are published on JFrog OSS resolvers += "akka-persistence-redis" at "http://oss.jfrog.org/oss-snapshot-local"

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.4.0")

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
  # optional
  password = "topsecret"
  db = 1
}

If using sentinel

redis {
  sentinel = true
  sentinel-master = "mymaster"  //master name
  sentinels = [{host :"localhost", port: 26379}] // list of sentinel addresses
}

Run Tests

Dockerfile is provided to set up Redis server to run tests.

# Build and start Redis docker container
docker build -t <your.name>/redis .
docker run -d -p 6379:6379 <your.name>/redis
# Run tests
sbt test
# Stop docker container
docker stop <container.id>

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 The namespaces can be overriden using the akka-persistence-redis.journal.key-namespace and akka-persistence-redis.snapshot.key-namespace.

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

More Repositories

1

grid

Drag and drop library for two-dimensional, resizable and responsive lists
JavaScript
3,572
star
2

atlantis

Atlantis is now being maintained at https://github.com/runatlantis/atlantis
Go
614
star
3

nachos

Material Chips for Android
Java
450
star
4

pre-commit-php

Pre-commit scripts appropriate for any PHP project. These hooks are made as custom plugins under the pre-commit git hook framework.
Shell
177
star
5

healthchecks

A go implementation of the Health Checks API used for microservice exploration, documentation and monitoring.
Go
132
star
6

health-checks-api

Standardize the way services and applications expose their status in a distributed application
API Blueprint
95
star
7

microservice-graph-explorer

Navigate and explore all of the microservices in your application in real time using the real application connections.
JavaScript
74
star
8

sens8

Kubernetes controller for Sensu checks
Go
42
star
9

token-ui

Text input components that allows to add 'tokens' rendered as pills.
Swift
42
star
10

hermes

Kotlin ktor application which bridges Github and Slack. Use it to automate common workflows involving those platforms
Kotlin
35
star
11

scala-circuit-breaker

A circuit breaker for Scala applications and services
Scala
35
star
12

wordpress-multisite-vagrant

JavaScript
27
star
13

sbt-swagger

SBT plugin for extracting Swagger & JAX-RS (jsr311) annotations from compiled classes into Swagger API models, which are then serialized to JSON for consumption with swagger-ui.
Scala
27
star
14

vault-ctrl-tool

Simple tool for managing authentication, secrets, and leases for services.
Go
26
star
15

backup53

AWS Route53 backup tool
Python
23
star
16

hootsuite-app-express

Sample Hootsuite app directory app using Express and Node.js
JavaScript
19
star
17

statsd-client

A lightweight library for generating statsd events from in Scala applications.
Scala
13
star
18

apis-101

Beginners-friendly introduction to APIs starter code.
JavaScript
11
star
19

maintenance-calendar-for-aws

Go
9
star
20

OwlBanners

Swift
7
star
21

emit

Simple signals library for Swift
Swift
6
star
22

udp-logger

UDP logging to logstash for logback and log4j.
Scala
6
star
23

microservice-graph-explorer-test

Runs services that implement the Health Checks API to be used when testing the Microservice Graph Explorer
Go
5
star
24

atlantis-example

A simple terraform project to use along with atlantis bootstrap mode
3
star
25

dropbox-media-library-sample

Media Library Sample App with Auth
JavaScript
1
star
26

atlantis-tests

A set of terraform projects that atlantis e2e tests run on.
HCL
1
star