二、配置org.springframework.boot spring-boot-starter-data-redis redis.clients jedis
使用本地redis
spring:
redis:
host: 127.0.0.1
port: 6379
password:
client-type: jedis
jedis:
pool:
max-active: 10
三、测试
@Slf4j
@SpringBootTest
public class MainApplicationTest {
@Autowired
StringRedisTemplate redisTemplate;
@Test
public void test5() {
ValueOperations operations = redisTemplate.opsForValue();
operations.set("hello","world");
String str = operations.get("hello");
log.info(str);
}



