1 redisson
2 spring boot + reddison
2.1 单机redis场景
1 引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson</artifactId>
<version>3.20.0</version>
</dependency>
2 redisson 配置
@Slf4j
@Configuration
public class RedissonConfig {
@Resource
private RedisProperties redisProperties;
private static int CURRENT = 2;
private static final int MINI_MUM_IDLE_SIZE = 4;