Преглед изворни кода

服务端LocalCache,降低磁盘读写压力;LRU 方式缓存最近 10000 条;

xuxueli пре 6 година
родитељ
комит
cca3958295
2 измењених фајлова са 38 додато и 27 уклоњено
  1. 8 0
      README.md
  2. 30 27
      doc/XXL-JOB官方文档.md

+ 8 - 0
README.md Прегледај датотеку

265
     - 153、天津青芒果科技有限公司 (芒果头条)
265
     - 153、天津青芒果科技有限公司 (芒果头条)
266
     - 154、长飞光纤光缆股份有限公司
266
     - 154、长飞光纤光缆股份有限公司
267
     - 155、世纪凯歌(北京)医疗科技有限公司
267
     - 155、世纪凯歌(北京)医疗科技有限公司
268
+    - 156、浙江霖梓控股有限公司
269
+    - 157、江西腾飞网络技术有限公司
270
+    - 158、安迅物流有限公司
271
+    - 159、肉联网
272
+    - 160、北京北广梯影广告传媒有限公司
273
+    - 161、上海数慧系统技术有限公司
274
+    - 162、大志天成
275
+    - 163、上海云鹊医
268
 	- ……
276
 	- ……
269
 
277
 
270
 > 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
278
 > 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。

+ 30 - 27
doc/XXL-JOB官方文档.md Прегледај датотеку

234
     - 153、天津青芒果科技有限公司 (芒果头条)
234
     - 153、天津青芒果科技有限公司 (芒果头条)
235
     - 154、长飞光纤光缆股份有限公司
235
     - 154、长飞光纤光缆股份有限公司
236
     - 155、世纪凯歌(北京)医疗科技有限公司
236
     - 155、世纪凯歌(北京)医疗科技有限公司
237
+    - 156、浙江霖梓控股有限公司
238
+    - 157、江西腾飞网络技术有限公司
239
+    - 158、安迅物流有限公司
240
+    - 159、肉联网
241
+    - 160、北京北广梯影广告传媒有限公司
242
+    - 161、上海数慧系统技术有限公司
243
+    - 162、大志天成
244
+    - 163、上海云鹊医
237
 	- ……
245
 	- ……
238
 
246
 
239
 > 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
247
 > 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
295
 
303
 
296
     xxl-job-admin:调度中心
304
     xxl-job-admin:调度中心
297
     xxl-job-core:公共依赖
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
         :xxl-job-executor-sample-jfinal:JFinal版本,通过JFinal管理执行器;
310
         :xxl-job-executor-sample-jfinal:JFinal版本,通过JFinal管理执行器;
302
         :xxl-job-executor-sample-nutz:Nutz版本,通过Nutz管理执行器;
311
         :xxl-job-executor-sample-nutz:Nutz版本,通过Nutz管理执行器;
303
         
312
         
382
 
391
 
383
 ### 2.4 配置部署“执行器项目”
392
 ### 2.4 配置部署“执行器项目”
384
 
393
 
385
-    “执行器”项目:xxl-job-executor-sample-spring (提供多种版本执行器供选择,现以Spring版本为例,可直接使用,也可以参考其并将现有项目改造成执行器)
394
+    “执行器”项目:xxl-job-executor-sample-springboot (提供多种版本执行器供选择,现以Spring版本为例,可直接使用,也可以参考其并将现有项目改造成执行器)
386
     作用:负责接收“调度中心”的调度并执行;可直接部署执行器,也可以将执行器集成到现有业务项目中。
395
     作用:负责接收“调度中心”的调度并执行;可直接部署执行器,也可以将执行器集成到现有业务项目中。
387
     
396
     
388
 #### 步骤一:maven依赖
397
 #### 步骤一:maven依赖
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
     xxl.job.accessToken=
416
     xxl.job.accessToken=
408
         
417
         
409
     ### xxl-job log path:执行器运行日志文件存储的磁盘位置,需要对该路径拥有读写权限
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
     ### xxl-job log retention days:执行器Log文件定期清理功能,指定日志保存天数,日志文件过期自动删除。限制至少保持3天,否则功能不生效;
421
     ### xxl-job log retention days:执行器Log文件定期清理功能,指定日志保存天数,日志文件过期自动删除。限制至少保持3天,否则功能不生效;
413
     xxl.job.executor.logretentiondays=-1
422
     xxl.job.executor.logretentiondays=-1
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
 #### 步骤四:部署执行器项目: