关于springboot集成redis,自己做笔记分享给有需要的朋友。视频实力节点王鹤老师讲授的springboot教程。由浅入深,带你体验SpringBoot极速的开发过程。内容丰富,涵盖了SpringBoot开发的方方面面,更新至SpringBoot2.x系列最新版本。视频链接:https://www.bilibili.com/video...redis可以帮助我们分散数据库的压力,有了它,可以更好的支持并发性能!可以这样理解,redis位于数据库和springboot框架之间,起到数据缓存的作用。在idea中集成了redis的插件配置后,创建完成后会得到idea的驱动和工具接口。之后,必须在本地启动redis服务。这个过程类似于启动mysql服务。我们可以去redis官网下载,根据自己的系统参考https://github.com/tporadowsk选择x64或者x32windows...参考Linux参考https://redis.io/download然后需要使用JavaLink在本地开启redis服务,缓存数据配置到redis--application.ymlspring:redis:host:127.0.0.1port:6379jedis:pool:max-active:8max-wait:-1msmax-idle:500tuce-let0min:shutdown-timeout:0ms测试类包com.example.demo;importorg.junit.jupiter.api.Test;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.boot.测试上下文。SpringBootTest;importorg.springframework.data.redis.core.RedisTemplate;@SpringBootTestclassDemoApplicationTests{@AutowiredprivateRedisTemplate
