Redis Plugin

The plugin provides a functionality to interact with Redis.

Installation

  1. Copy the below line to dependencies section of the project build.gradle file

    Please make sure to use the same version for all VIVIDUS dependencies.
    Example 1. build.gradle
    implementation('org.vividus:vividus-plugin-redis')
  2. If the project was imported to the IDE before adding new dependency, re-generate the configuration files for the used IDE and then refresh the project in the used IDE.

Properties

It’s allowed to configure an unlimited number of Redis connections via the mechanism of the dynamic properties. The properties prefix example is:

redis.connection.my-redis-instance=redis://username:password@hostname:port?ssl=true&connectTimeout=5000

where my-redis-instance is a key used to refer a Redis connection in the steps. The key is defined by users, must be unique and can’t contain dots.

Steps

Flush database

Removes all keys from the specified Redis database.

When I flush `$dbIndex` database on `$instanceKey` Redis instance
  • dbIndex — the non-negative index of the Redis database to flush

  • instanceKey — the key identifying the Redis instance in the connections config

Example 2. Flush database keys
When I flush `0` database on `my-redis` Redis instance