Lesson 8. Integrating with Redis
Lesson 8. Integrating with Redis
Library
<dependency>
<groupId>io.lettuce</groupId>
<artifactId>lettuce-core</artifactId>
<version>Latest</version>
</dependency>Establish connection
RedisClient redisClient;
StatefulRedisConnection<String, String> redisConnection;
RedisCommands<String, String> syncCommands;
redisClient = RedisClient.create("redis://localhost:6379/0"); // Format: redis://ip:post/dbNumber
redisConnection = redisClient.connect();
syncCommands = this.redisConnection.sync();Connection established
Last updated