Configuring Lettuce

Using the CLI

If you are creating 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 you should first add the redis-lettuce module to your classpath:

build.gradle

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

You should then configure the URI of the Redis server you wish to communicate with in application.yml:

Configuring redis.uri

  1. redis:
  2. uri: redis://localhost
The redis.uri setting should 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.