-
Notifications
You must be signed in to change notification settings - Fork 946
Getting started (4.x)
You can get started with lettuce in various ways.
Add these lines to file pom.xml:
<dependency>
<groupId>biz.paluch.redis</groupId>
<artifactId>lettuce</artifactId>
<version>4.4.4.Final</version>
</dependency>
Add these lines to file ivy.xml:
<ivy-module>
<dependencies>
<dependency org="biz.paluch.redis" name="lettuce" rev="4.4.4.Final"/>
</dependencies>
</ivy-module>
Add these lines to file build.gradle:
dependencies {
compile 'biz.paluch.redis:lettuce:4.4.4.Final'
}
Download the latest binary package from https://github.com/mp911de/lettuce/releases and extract the archive.
So easy! No more boring routines, we can start.
Import required classes:
import com.lambdaworks.redis.*;
and now, write your code:
RedisClient redisClient = RedisClient.create("redis://password@localhost:6379/0");
StatefulRedisConnection<String, String> connection = redisClient.connect();
RedisCommands<String, String> syncCommands = connection.sync();
syncCommands.set("key", "Hello, Redis!");
connection.close();
redisClient.shutdown();
Done!
Do you want to see working examples?
This wiki and the README document contains a lot of information, please take your time and read these instructions carefully.
If you run into any trouble, you may start with getting started.
We provide detailed changes for each Lettuce release.
Be sure to read the CONTRIBUTING guidelines before reporting a new Lettuce issue or open a pull request.
If you have any questions about the Lettuce usage or want to share some information with the community, please go to one of the following places:
- GitHub Discussions
- for chatting
More resources:
- Javadoc
- Build status: Travis CI
- All versions: Maven Central
- Snapshots: Sonatype OSS Repository
Intro
Getting started
- Getting started
- Redis URI and connection details
- Basic usage
- Asynchronous API
- Reactive API
- Publish/Subscribe
- Transactions/Multi
- Scripting and Functions
- Redis Command Interfaces
- FAQ
HA and Sharding
Advanced usage
- Configuring Client resources
- Client Options
- Dynamic Command Interfaces
- SSL Connections
- Native Transports
- Unix Domain Sockets
- Streaming API
- Events
- Command Latency Metrics
- Tracing
- Stateful Connections
- Pipelining/Flushing
- Connection Pooling
- Graal Native Image
- Custom commands
Integration and Extension
Internals