-
Notifications
You must be signed in to change notification settings - Fork 983
Getting started
Mark Paluch edited this page Mar 13, 2024
·
17 revisions
You can get started with Lettuce in various ways.
Add these lines to file pom.xml:
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>6.3.2.RELEASE</version>
</dependency>
Add these lines to file ivy.xml:
<ivy-module>
<dependencies>
<dependency org="io.lettuce" name="lettuce-core" rev="6.3.2.RELEASE"/>
</dependencies>
</ivy-module>
Add these lines to file build.gradle:
dependencies {
implementation 'io.lettuce:lettuce-core:6.3.2.RELEASE'
}
Download the latest binary package from https://github.com/lettuce-io/lettuce-core/releases and extract the archive.
So easy! No more boring routines, we can start.
Import required classes:
import io.lettuce.core.*;
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?
Lettuce documentation was moved to https://redis.github.io/lettuce/overview/
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