|
@@ -234,6 +234,14 @@ XXL-JOB是一个轻量级分布式任务调度平台,其核心设计目标是
|
234
|
234
|
- 153、天津青芒果科技有限公司 (芒果头条)
|
235
|
235
|
- 154、长飞光纤光缆股份有限公司
|
236
|
236
|
- 155、世纪凯歌(北京)医疗科技有限公司
|
|
237
|
+ - 156、浙江霖梓控股有限公司
|
|
238
|
+ - 157、江西腾飞网络技术有限公司
|
|
239
|
+ - 158、安迅物流有限公司
|
|
240
|
+ - 159、肉联网
|
|
241
|
+ - 160、北京北广梯影广告传媒有限公司
|
|
242
|
+ - 161、上海数慧系统技术有限公司
|
|
243
|
+ - 162、大志天成
|
|
244
|
+ - 163、上海云鹊医
|
237
|
245
|
- ……
|
238
|
246
|
|
239
|
247
|
> 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
|
|
@@ -295,9 +303,10 @@ XXL-JOB是一个轻量级分布式任务调度平台,其核心设计目标是
|
295
|
303
|
|
296
|
304
|
xxl-job-admin:调度中心
|
297
|
305
|
xxl-job-core:公共依赖
|
298
|
|
- xxl-job-executor:执行器Sample示例(选择合适的版本执行器,可直接使用,也可以参考其并将现有项目改造成执行器)
|
299
|
|
- :xxl-job-executor-sample-spring:Spring版本,通过Spring容器管理执行器,比较通用,推荐这种方式;
|
300
|
|
- :xxl-job-executor-sample-springboot:Springboot版本,通过Springboot管理执行器;
|
|
306
|
+ xxl-job-executor-samples:执行器Sample示例(选择合适的版本执行器,可直接使用,也可以参考其并将现有项目改造成执行器)
|
|
307
|
+ :xxl-job-executor-sample-springboot:Springboot版本,通过Springboot管理执行器,推荐这种方式;
|
|
308
|
+ :xxl-job-executor-sample-spring:Spring版本,通过Spring容器管理执行器,比较通用;
|
|
309
|
+ :xxl-job-executor-sample-frameless:无框架版本;
|
301
|
310
|
:xxl-job-executor-sample-jfinal:JFinal版本,通过JFinal管理执行器;
|
302
|
311
|
:xxl-job-executor-sample-nutz:Nutz版本,通过Nutz管理执行器;
|
303
|
312
|
|
|
@@ -382,7 +391,7 @@ docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-jo
|
382
|
391
|
|
383
|
392
|
### 2.4 配置部署“执行器项目”
|
384
|
393
|
|
385
|
|
- “执行器”项目:xxl-job-executor-sample-spring (提供多种版本执行器供选择,现以Spring版本为例,可直接使用,也可以参考其并将现有项目改造成执行器)
|
|
394
|
+ “执行器”项目:xxl-job-executor-sample-springboot (提供多种版本执行器供选择,现以Spring版本为例,可直接使用,也可以参考其并将现有项目改造成执行器)
|
386
|
395
|
作用:负责接收“调度中心”的调度并执行;可直接部署执行器,也可以将执行器集成到现有业务项目中。
|
387
|
396
|
|
388
|
397
|
#### 步骤一:maven依赖
|
|
@@ -391,7 +400,7 @@ docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-jo
|
391
|
400
|
#### 步骤二:执行器配置
|
392
|
401
|
执行器配置,配置文件地址:
|
393
|
402
|
|
394
|
|
- /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/resources/xxl-job-executor.properties
|
|
403
|
+ /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/resources/application.properties
|
395
|
404
|
|
396
|
405
|
执行器配置,配置内容说明:
|
397
|
406
|
|
|
@@ -407,7 +416,7 @@ docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-jo
|
407
|
416
|
xxl.job.accessToken=
|
408
|
417
|
|
409
|
418
|
### xxl-job log path:执行器运行日志文件存储的磁盘位置,需要对该路径拥有读写权限
|
410
|
|
- xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler/
|
|
419
|
+ xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler
|
411
|
420
|
|
412
|
421
|
### xxl-job log retention days:执行器Log文件定期清理功能,指定日志保存天数,日志文件过期自动删除。限制至少保持3天,否则功能不生效;
|
413
|
422
|
xxl.job.executor.logretentiondays=-1
|
|
@@ -417,31 +426,25 @@ docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl-jo
|
417
|
426
|
|
418
|
427
|
执行器组件,配置文件地址:
|
419
|
428
|
|
420
|
|
- /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-spring/src/main/resources/applicationcontext-xxl-job.xml
|
|
429
|
+ /xxl-job/xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/core/config/XxlJobConfig.java
|
421
|
430
|
|
422
|
431
|
执行器组件,配置内容说明:
|
423
|
432
|
|
424
|
433
|
```
|
425
|
|
-<!-- 配置01、JobHandler 扫描路径:自动扫描容器中JobHandler -->
|
426
|
|
-<context:component-scan base-package="com.xxl.job.executor.service.jobhandler" />
|
427
|
|
-
|
428
|
|
-<!-- 配置02、执行器 -->
|
429
|
|
-<bean id="xxlJobExecutor" class="com.xxl.job.core.executor.XxlJobExecutor" init-method="start" destroy-method="destroy" >
|
430
|
|
- <!-- 执行器注册中心地址[选填],为空则关闭自动注册 -->
|
431
|
|
- <property name="adminAddresses" value="${xxl.job.admin.addresses}" />
|
432
|
|
- <!-- 执行器AppName[选填],为空则关闭自动注册 -->
|
433
|
|
- <property name="appName" value="${xxl.job.executor.appname}" />
|
434
|
|
- <!-- 执行器IP[选填],为空则自动获取 -->
|
435
|
|
- <property name="ip" value="${xxl.job.executor.ip}" />
|
436
|
|
- <!-- 执行器端口号[选填],小于等于0则自动获取 -->
|
437
|
|
- <property name="port" value="${xxl.job.executor.port}" />
|
438
|
|
- <!-- 访问令牌[选填],非空则进行匹配校验 -->
|
439
|
|
- <property name="accessToken" value="${xxl.job.accessToken}" />
|
440
|
|
- <!-- 执行器日志路径[选填],为空则使用默认路径 -->
|
441
|
|
- <property name="logPath" value="${xxl.job.executor.logpath}" />
|
442
|
|
- <!-- 日志保存天数[选填],值大于3时生效 -->
|
443
|
|
- <property name="logRetentionDays" value="${xxl.job.executor.logretentiondays}" />
|
444
|
|
-</bean>
|
|
434
|
+@Bean(initMethod = "start", destroyMethod = "destroy")
|
|
435
|
+public XxlJobSpringExecutor xxlJobExecutor() {
|
|
436
|
+ logger.info(">>>>>>>>>>> xxl-job config init.");
|
|
437
|
+ XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
|
438
|
+ xxlJobSpringExecutor.setAdminAddresses(adminAddresses); // 执行器注册中心地址[选填],为空则关闭自动注册
|
|
439
|
+ xxlJobSpringExecutor.setAppName(appName); // 执行器AppName[选填],为空则关闭自动注册
|
|
440
|
+ xxlJobSpringExecutor.setIp(ip); // 执行器IP[选填],为空则自动获取
|
|
441
|
+ xxlJobSpringExecutor.setPort(port); // 执行器端口号[选填],小于等于0则自动获取
|
|
442
|
+ xxlJobSpringExecutor.setAccessToken(accessToken); // 访问令牌[选填],非空则进行匹配校验
|
|
443
|
+ xxlJobSpringExecutor.setLogPath(logPath); // 执行器日志路径[选填],为空则使用默认路径
|
|
444
|
+ xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays); // 日志保存天数[选填],值大于3时生效
|
|
445
|
+
|
|
446
|
+ return xxlJobSpringExecutor;
|
|
447
|
+}
|
445
|
448
|
```
|
446
|
449
|
|
447
|
450
|
#### 步骤四:部署执行器项目:
|