-
Notifications
You must be signed in to change notification settings - Fork 979
Getting started (4.x)
Mark Paluch edited this page Jun 13, 2020
·
3 revisions
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?
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