redis/lettuce
redis/lettuce has 5,786 GitHub stars and 1,121 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-06 14:38 UTC. Last push 2026-11-02.
Redis Java client
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
Lettuce - Advanced Java Redis client
Lettuce is a scalable thread-safe Redis client for synchronous,
asynchronous and reactive usage. Multiple threads may share one connection if they avoid blocking and transactional
operations such as BLPOP and MULTI/EXEC.
Lettuce is built with netty.
Supports advanced Redis features such as Sentinel, Cluster, Pipelining, Auto-Reconnect and Redis data models.
This version of Lettuce has been tested against the latest Redis source-build.
- synchronous, asynchronous and reactive usage
- Redis Sentinel
- Redis Cluster
- SSL and Unix Domain Socket connections
- Streaming API
- Codecs (for UTF8/bit/JSON etc. representation of your data)
- multiple Command Interfaces
- Support for Native Transports
- Support RediSearch, RedisJSON and Redis Vector Sets
- Compatible with Java 8++ (implicit automatic module w/o descriptors)
See the reference documentation and API Reference for more details.
How do I Redis?
Learn for free at Redis University
Documentation
Binaries/Download
Binaries and dependency information for Maven, Ivy, Gradle and others can be found at http://search.maven.org.
Releases of lettuce are available in the Maven Central repository. Take also a look at the Releases.
Example for Maven:
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>x.y.z</version>
</dependency>
If you'd rather like the latest snapshots of the upcoming major version, use our Maven snapshot repository and declare the appropriate dependency version.
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>x.y.z.BUILD-SNAPSHOT</version>
</dependency>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype Snapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
Basic Usage
RedisClient client = RedisClient.create("redis://localhost");
StatefulRedisConnection<String, String> connection = client.connect();
RedisStringCommands sync = connection.sync();
String value = sync.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 Basic usage for further details.
Asynchronous API
StatefulRedisConnection<String, String> connection = client.connect();
RedisStringAsyncCommands<String, String> async = connection.async();
RedisFuture<String> set = async.set("key", "value");
RedisFuture<String> get = async.get("key");
LettuceFutures.awaitAll(set, get) == true
set.get() == "OK"
get.get() == "value"
See Asynchronous API for further details.
Reactive API
StatefulRedisConnection<String, String> connection = client.connect();
RedisStringReactiveCommands<String, String> reactive = connection.reactive();
Mono<String> set = reactive.set("key", "value");
Mono<String> get = reactive.get("key");
set.subscribe();
get.block() == "value"
See Reactive API for further details.
Pub/Sub
RedisPubSubCommands<String, String> connection = client.connectPubSub().sync();
connection.getStatefulConnection().addListener(new RedisPubSubListener<String, String>() { ... })
connection.subscribe("channel");
Building
Lettuce is built with Apache Maven. The tests require multiple running Redis instances for different test cases which
are configured using a Makefile. Tests run by default against Redis latest.
To build:
$ git clone https://github.com/redis/lettuce.git
$ cd lettuce/
$ make start
- Run the build:
make test - Start Redis (manually):
make start - Stop Redis (manually):
make stop - Clean up:
make clean
Bugs and Feedback
For bugs, questions and discussions please use the GitHub Issues.
License
- This repository is licensed under the "MIT" license. See LICENSE.
- Fork of https://github.com/wg/lettuce
Contributing
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 CONTRIBUTING.md
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,402 starspublic-apis/public-apis
A collective list of free APIs
496,719 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
437,723 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,058 stars