需要的jar包
<dependency>
<groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId>
<version>3.17.0</version>
</dependency>
配置: 哨兵,主从,集群模式的配置可以去看官网,地址:
这里使用单节点,配置如下,注意redis的地址写法,要加redis:://
@Configuration
public class MyRedissonConfig {
@Bean
// (destroyMethod = "shutdown")
public RedissonClient redissonClient() {
Config