Configuring Lettuce

Using the CLI

If you create your project using the Micronaut CLI, supply the redis-lettuce feature to configure the Lettuce driver in your project:

  1. $ mn create-app my-app features redis-lettuce

To configure the Lettuce driver, first add the redis-lettuce module to your build:

build.gradle

  1. compile "io.micronaut.redis:micronaut-redis-lettuce"

Then configure the URI of the Redis server in application.yml:

Configuring redis.uri

  1. redis:
  2. uri: redis://localhost
The redis.uri setting must be in the format as described in the Connection URIs section of the Lettuce wiki

You can also specify multiple Redis URIs using redis.uris, in which case a RedisClusterClient is created instead.

For more information and further documentation see the Micronaut Redis documentation.