分布式任务调度
1、任务调度 即定时任务 2、Quartz使用入门 1、依赖 < dependency > < groupId > org.quartz-scheduler </ groupId > < artifactId > quartz </ artifactId > < version > 2.2.1 </ version > </ dependency > < dependency > < groupId > org.quartz-scheduler </ groupId > < artifactId > quartz-jobs </ artifactId > < version > 2.2.1 </ version > </dependency> 2、编码 1、实现Job接口 2、实现 3、分布式job的幂等问题 即不重复触发 1、实现方案 1、使用分布式锁 2、使用不同配置文件 2、传统定时任务缺点 1、报错后只能等到第二天触发 2、不支持集群 3、不支持路由策略(分发) 4、任务状态监控,报警机制缺失 4、XXL-JOB 1、源码获取 搜索xxl-job即可,git开源代码 2、原理 1、执行器:执行具体任务的实例 2、调度中心:xxl-job-admin 3、运行 很简单,看文档就行了 来源: