<dependencies> <dependency> <groupId>com.lambdaworks</groupId> <artifactId>lettuce</artifactId> <version>5.4.3.Final</version> </dependency> </dependencies> import io.lettuce.core.RedisClient; import io.lettuce.core.RedisConnection; import io.lettuce.core.api.StatefulRedisConnection; import io.lettuce.core.api.sync.RedisCommands; RedisClient redisClient = RedisClient.create("redis://localhost:6379"); StatefulRedisConnection<String, String> connection = redisClient.connect(); RedisCommands<String, String> syncCommands = connection.sync(); String value = syncCommands.get("key"); connection.close(); redisClient.shutdown();


上一篇:
下一篇:
切换中文