簡介:基於Netty框架的事件驅動的通信層,Redis 客戶端,線程安全同步。異步調用。
lettuce 官網地址:https://lettuce.io/
lettuce git項目地址:https://github.com/lettuce-io/lettuce-core
使用:
1、在pom.xml 中加入依賴
2、 調用
import io.lettuce.core.*;
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();
