Class LettuceConnection

java.lang.Object
org.springframework.data.redis.connection.AbstractRedisConnection
org.springframework.data.redis.connection.lettuce.LettuceConnection
All Implemented Interfaces:
AutoCloseable, DefaultedRedisConnection, RedisCommands, RedisCommandsProvider, RedisConnection, RedisConnectionCommands, RedisGeoCommands, RedisHashCommands, RedisHyperLogLogCommands, RedisKeyCommands, RedisListCommands, RedisPubSubCommands, RedisScriptingCommands, RedisServerCommands, RedisSetCommands, RedisStreamCommands, RedisStringCommands, RedisTxCommands, RedisZSetCommands
Direct Known Subclasses:
LettuceClusterConnection

@NullUnmarked public class LettuceConnection extends AbstractRedisConnection
RedisConnection implementation on top of Lettuce Redis client.

While the underlying Lettuce RedisClient and StatefulRedisConnection instances used by LettuceConnection are Thread-safe, this class itself is not Thread-safe. Therefore, instances of LettuceConnection should not be shared across multiple Threads when executing Redis commands and other operations. If optimal performance is required by your application(s), then we recommend direct access to the low-level, API provided by the underlying Lettuce client library (driver), where such Thread-safety guarantees can be made. Simply call getNativeConnection() and use the native resource as required.

Author:
Costin Leau, Jennifer Hickey, Christoph Strobl, Thomas Darimont, David Liu, Mark Paluch, Ninad Divadkar, Tamil Selvan, ihaohong, John Blum, Jaeik Jeong