Advanced Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
Clone or download
Pull request Compare This branch is 982 commits behind lettuce-io:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

lettuce - Advanced Java Redis client

Build Status Coverage Status Maven Central

Lettuce is a scalable thread-safe Redis client providing both synchronous and asynchronous connections. Multiple threads may share one connection provided they avoid blocking and transactional operations such as BLPOP, and MULTI/EXEC. Multiple connections are efficiently managed by the excellent netty NIO framework. Support for advanced Redis features such as Sentinel, Cluster and Redis data models is included.

This version of lettuce has been tested against Redis 3.0.

See the Wiki for more docs.

I'm developing and maintaining actively the fork of https://github/wg/lettuce




Binaries and dependency information for Maven, Ivy, Gradle and others can be found at

Releases of lettuce are available in the maven central repository. Take also a look at the Download page in the Wiki.

Example for Maven:


Shaded JAR-File (packaged dependencies and relocated to the com.lambdaworks package to prevent version conflicts)





or snapshots at

Basic Usage

  RedisClient client = RedisClient.create("redis://localhost")
  RedisStringsConnection<String, String> connection = client.connect()
  String value = connection.get("key")

Each Redis command is implemented by one or more methods with names identical to the lowercase Redis command name. Complex commands with multiple modifiers that change the result type include the CamelCased modifier as part of the command name, e.g. zrangebyscore and zrangebyscoreWithScores.

See for further details.

Asynchronous Connections

RedisStringsConnection<String, String> async = client.connectAsync()
RedisFuture<String> set = async.set("key", "value")
RedisFuture<String> get = async.get("key")

async.awaitAll(set, get) == true

set.get() == "OK"
get.get() == "value"

See for further details.


RedisPubSubConnection<String, String> connection = client.connectPubSub()
connection.addListener(new RedisPubSubListener<String, String>() { ... })


Lettuce is built with Apache Maven. The tests require multiple running Redis instances for different test cases which are configured using a Makefile. All tests run against Redis branch 3.0

To build:

$ git clone
$ cd lettuce/
$ make prepare ssl-keys
$ make test
  • Initial environment setup (clone and build redis): make prepare
  • Setup SSL Keys: make ssl-keys
  • Run the build: make test
  • Start Redis (manually): make start
  • Stop Redis (manually): make stop

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.



Github is for social coding: if you want to write code, I encourage contributions through pull requests from forks of this repository. Create Github tickets for bugs and new features and comment on the ones that you are interested in and take a look into