- Notifications
You must be signed in to change notification settings - Fork30
Akka Persistence that uses Redis as backend
License
hootsuite/akka-persistence-redis
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is a plugin for Akka Persistence that uses Redis as backend. It usesrediscala, an asynchronous Redis client written with Akka and Scala.It also depends on play-json for JSON serialization.
Use versions from0.9.0
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.9.0")Use versions from0.7.0
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.7.0")Use0.6.0
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.6.0")Use0.5.0
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.3.0")Use0.2.2
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.2.2")Deprecated methods since Akka 2.3.4 are NOT implemented. As a result, some tests inTCK fail.Rest of methods are tested with the test harness included in this project.
Development snapshots are published on JFrog OSSresolvers += "akka-persistence-redis" at "http://oss.jfrog.org/oss-snapshot-local"
build.sbt
resolvers += Resolver.jcenterRepo // Adds Bintray to resolvers for akka-persistence-redis and rediscalalibraryDependencies ++= Seq("com.hootsuite" %% "akka-persistence-redis" % "0.4.0")akka.persistence.journal.plugin = "akka-persistence-redis.journal"akka.persistence.snapshot-store.plugin = "akka-persistence-redis.snapshot"Fromrediscala
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}Dockerfile is provided to set up Redis server to run tests.
# Build and start Redis docker containerdocker build -t <your.name>/redis .docker run -d -p 6379:6379 <your.name>/redis# Run testssbt test# Stop docker containerdocker stop <container.id>Journal and snapshot use "journal:" and "snapshot:" as part of keys respectively as it is a good practice to create namespace for keysreferenceThe namespaces can be overriden using the akka-persistence-redis.journal.key-namespace and akka-persistence-redis.snapshot.key-namespace.
In order to enforce ordering, journal entries and snapshots are inserted intoSorted Set and sorted by sequenceNr
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())}Contribute by submitting a PR and a bug report in GitHub.
About
Akka Persistence that uses Redis as backend
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.