xxl-job-patterns
Installation
SKILL.md
XXL-JOB 最佳实践模式
来源:https://github.com/xuxueli/xxl-job
基于 hiwepy/xxljob-spring-boot-starter(Spring Boot Starter 封装)
Capability Boundaries
✅ Strong Suits
- @XxlJobCron 注解 — 100%替代@XxlJob,代码即配置(cron/desc/author/selfStarting 全部在代码中)
- 启动自动注册 — selfStarting=true 时,执行器启动自动将任务注册到Admin(无需手动在UI创建)
- XxlJobTemplate — 编程式管理任务(添加/更新/删除/启动/停止/触发),session自动续期
- v2/v3双版本兼容 — Admin版本参数差异(v3用ids[]、v2用id),自动适配
- Micrometer指标 — 自动采集任务执行次数/成功/失败/耗时,对接Prometheus
- Unirest HTTP客户端 — 自动配置SSL(trust-all)/Cookie管理/超时
❌ Out of Scope
- 简单单机定时任务 → @Scheduled
- 替代方案:PowerJob(功能更强)、ElasticJob(无中心化)