Persisting the state to Redis
Redis is a popular in-memory data store. It supports multiple data structures that allow developers to use it as a database, cache, or even a message broker. Redis also supports replication, transactions, and some other useful features that makes it attractive to use it as our data store for Akka persistence. In this recipe, we will review how to bring in the required dependencies, define Redis as your desired plugin for journal and snapshots, and run a small app to test it out.
Getting ready
To step through this recipe, we need to import the hell0-Akka
project in the IDE; other prerequisites are the same as earlier as we have downloaded the akka-persistence
dependency. We will need a Redis instance to test this recipe. For convenience, we will assume we have one instance running on the default port 6379
. In this recipe, we are going to make use of the classes defined in the previous recipe, Persisting state to Cassandra.
Note
To install Redis, follow the steps...