使用Redisson分布式锁实现服务多节点部署,单节点执行定时任务,保证任务不会重复执行
1.技术点Scheduling、redisson;
redssion依赖 pom%
1 | <dependency> |
2.配置redisson实体类
1 | @Configuration |
3.实战demo
1 | @Scheduled(fixedRate = 1000 * 60) |
更多redisson使用技巧请看官网
1.技术点Scheduling、redisson;
redssion依赖 pom%
1 | <dependency> |
2.配置redisson实体类
1 | @Configuration |
3.实战demo
1 | @Scheduled(fixedRate = 1000 * 60) |
更多redisson使用技巧请看官网