Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7d621452
authored
Oct 08, 2018
by
xuxueli
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master'
2 parents
1a02e2e1
23c549a3
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
67 additions
and
42 deletions
doc/XXL-JOB官方文档.md
pom.xml
xxl-job-admin/Dockerfile
xxl-job-admin/pom.xml
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java
xxl-job-admin/src/main/resources/i18n/message.properties
xxl-job-admin/src/main/resources/i18n/message_en.properties
xxl-job-core/pom.xml
xxl-job-executor-samples/pom.xml
xxl-job-executor-samples/xxl-job-executor-sample-jfinal/pom.xml
xxl-job-executor-samples/xxl-job-executor-sample-nutz/pom.xml
xxl-job-executor-samples/xxl-job-executor-sample-spring/pom.xml
xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml
doc/XXL-JOB官方文档.md
View file @
7d62145
...
...
@@ -335,7 +335,7 @@ XXL-JOB譏ッ荳荳ェ霓サ驥冗コァ蛻クシ丈ササ蜉。隹コヲ蟷ウ蜿ー悟譬ク蠢ョセ隶。逶ョ譬弍
### xxl-job admin address list:调度中心部署跟地址:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调"。
xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
### xxl-job executor address:执行器"AppName"和地址信息配置:AppName执行器心跳注册分组依据;地址信息用于"调度中心请求并触发任务"和"执行器注册"。执行器默认端口为9999,执行器IP默认为空表示自动获取IP,多网卡时可手动设置指定IP,手动设置IP时将会绑定Host。单机部署多个执行器时,注意要配置不同执行器端口;
### xxl-job executor address:执行器"AppName"和地址信息配置:AppName执行器心跳注册分组依据;地址信息用于"调度中心请求并触发任务"和"执行器注册"。执行器默认端口为9999,执行器IP默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用。单机部署多个执行器时,注意要配置不同执行器端口;
xxl.job.executor.appname=xxl-job-executor-sample
xxl.job.executor.ip=
xxl.job.executor.port=9999
...
...
@@ -1000,6 +1000,14 @@ API譛榊苅隸キ豎ょ盾閠サ」遐シ喞om.xxl.executor.test.DemoJobHandlerTest
默认提供邮件失败告警,可扩展短信、钉钉等方式,扩展代码位置为 "JobFailMonitorHelper.failAlarm";
### 5.19 调度中心Docker镜像构建
可以通过以下命令快速构建调度中心,并启动运行;
```
mvn clean package
docker build -t xuxueli/xxl-job-admin ./xxl-job-admin
docker run --name xxl-job-admin -p 8080:8080 -d xuxueli/xxl-job-admin
```
## 六、版本更新日志
### 6.1 版本 V1.1.x,新特性[2015-12-05]
**【于V1.1.x版本,XXL-JOB正式应用于我司,内部定制别名为 “Ferrari”,新接入应用推荐使用最新版本】**
...
...
@@ -1257,7 +1265,7 @@ Tips: 蜴彰迚域悽(V1.3.x)逶ョ蜑榊キイ扈蹴elease閾ウ遞ウ螳夂沿譛ャ, 霑帛扈エ謚、髦カ谿オ
-
7、修复脚本任务Log文件未正常close的问题;
-
8、项目依赖全量升级至较新稳定版本,如spring、jackson等等;
### 6.22 版本 V1.9.2 特性[迭代中
]
### 6.22 版本 V1.9.2 特性[201
8-10-05]
-
1、任务超时控制:新增任务属性 "任务超时时间",并支持自定义,任务运行超时将会主动中断任务;
-
2、任务失败重试次数:新增任务属性 "失败重试次数",并支持自定义,当任务失败时将会按照预设的失败重试次数主动进行重试;同时收敛废弃其他失败重试策略,如调度失败、执行失败、状态码失败等;
-
3、新增任务运行模式 "GLUE模式(PHP) ",支持php脚本任务;
...
...
@@ -1298,33 +1306,40 @@ Tips: 蜴彰迚域悽(V1.3.x)逶ョ蜑榊キイ扈蹴elease閾ウ遞ウ螳夂沿譛ャ, 霑帛扈エ謚、髦カ谿オ
-
38、GLUE任务脚本字段类型调整,改为mediumtext类型,提高GLUE长度上限;
-
39、任务监控线程Log输出优化,运行中任务的监控Log改为debug级别,减少非核心日志量;
-
40、项目依赖全量升级至较新稳定版本,如spring、Jackson、groovy等等;
-
41、docker支持:调度中心提供 Dockerfile 方便快速构建docker镜像;
### 6.23 版本 V2.0.0 特性[迭代中]
-
1、
[
迭代中
]
调度中心迁移到springboot;
-
2、
[
迭代中
]
SimpleTrigger 支持;
-
3、
[
迭代中
]
任务状态与quartz解耦,降低quartz调度压力,仅NORMAL状态任务绑定quartz;
-
4、
[
迭代中
]
新增任务默认运行状态,任务更新时运行状态保持不变;
-
5、
[
迭代中
]
任务权限管理:执行器为粒度分配权限,核心操作校验权限;
-
6、
[
迭代中
]
Release发布时,一同发布调度中心安装包,真正实现开箱即用;
-
7、
[
迭代中
]
docker镜像,并且推送docker镜像到中央仓库,更进一步实现产品开箱即用;
### TODO LIST
-
1、任务权限管理:执行器为粒度分配权限,核心操作校验权限;
-
2、任务分片路由:分片采用一致性Hash算法计算出尽量稳定的分片顺序,即使注册机器存在波动也不会引起分批分片顺序大的波动;目前采用IP自然排序,可以满足需求,待定;
-
3、任务单机多线程:提升任务单机并行处理能力;
-
4、任务依赖,流程图,子任务+会签任务,各节点日志;
-
5、调度任务优先级;
-
6、移除quartz依赖,重写调度模块:新增或恢复任务时将下次执行记录插入delayqueue,调度中心集群竞争分布式锁,成功节点批量加载到期delayqueue数据,批量执行。
-
7、springboot 和 docker镜像,并且推送docker镜像到中央仓库,更进一步实现产品开箱即用;
-
8、多数据库支持;
-
9、执行器Log清理功能:调度中心Log删除时同步删除执行器中的Log文件;
-
10、Bean模式任务,JobHandler自动从执行器中查询展示为下拉框,选择后自动填充任务名称等属性;
-
11、API事件触发类型任务(更类似MQ消息)支持"动态传参、延时消费";该类型任务不走Quartz,单独建立MQ消息表,调度中心竞争触发;待定,该功能与 XXL-MQ 冲突,该场景建议用后者;
-
12、调度线程池改为协程方式实现,大幅降低系统内存消耗;
-
13、任务依赖增强,新增任务类型 "流程任务",流程节点可挂载普通类型任务,承担任务依赖功能。现有子任务模型取消;需要考虑任务依赖死循环问题;
-
14、任务告警逻辑调整:任务调度,以及任务回调失败时,均推送监控队列。后期考虑通过任务Log字段控制告警状态;
-
15、新增任务默认运行状态,任务更新时运行状态保持不变;
-
16、提供多版本执行器:不依赖容器版本、不内嵌Jetty版本(通过配置executoraddress替换jetty通讯)等;
-
17、注册中心支持扩展,除默认基于DB之外,支持扩展接入第三方注册中心如zk、eureka等;
-
18、流程任务,支持参数传递;
-
19、SimpleTrigger 支持;
-
20、Release发布时,一同发布调度中心安装包,真正实现开箱即用;
-
21、Cron TimeZone 自定义;
-
22、忙碌转移优化,全部机器忙碌时不再直接失败;
-
23、流程任务等,透传动态参数;
-
24、任务状态与quartz解耦,降低quartz调度压力,仅NORMAL状态任务绑定quartz;
-
25、批量触发支持,添加参数 "org.quartz.scheduler.batchTriggerAcquisitionMaxCount: 50";
-
1、任务分片路由:分片采用一致性Hash算法计算出尽量稳定的分片顺序,即使注册机器存在波动也不会引起分批分片顺序大的波动;目前采用IP自然排序,可以满足需求,待定;
-
2、任务单机多线程:提升任务单机并行处理能力;
-
3、任务依赖,流程图,子任务+会签任务,各节点日志;
-
4、调度任务优先级;
-
5、移除quartz依赖,重写调度模块:新增或恢复任务时将下次执行记录插入delayqueue,调度中心集群竞争分布式锁,成功节点批量加载到期delayqueue数据,批量执行。
-
6、多数据库支持,在重写并移除Quartz的基础上,DAO层通过JPA实现,不限制数据库类型;
-
7、执行器Log清理功能:调度中心Log删除时同步删除执行器中的Log文件;
-
8、Bean模式任务,JobHandler自动从执行器中查询展示为下拉框,选择后自动填充任务名称等属性;
-
9、API事件触发类型任务(更类似MQ消息)支持"动态传参、延时消费";该类型任务不走Quartz,单独建立MQ消息表,调度中心竞争触发;待定,该功能与 XXL-MQ 冲突,该场景建议用后者;
-
10、调度线程池改为协程方式实现,大幅降低系统内存消耗;
-
11、任务依赖增强,新增任务类型 "流程任务",流程节点可挂载普通类型任务,承担任务依赖功能。现有子任务模型取消;需要考虑任务依赖死循环问题;
-
12、任务告警逻辑调整:任务调度,以及任务回调失败时,均推送监控队列。后期考虑通过任务Log字段控制告警状态;
-
13、提供多版本执行器:不依赖容器版本、不内嵌Jetty版本(通过配置executoraddress替换jetty通讯)等;
-
14、注册中心支持扩展,除默认基于DB之外,支持扩展接入第三方注册中心如zk、eureka等;
-
15、流程任务,支持参数传递;
-
16、Cron TimeZone 自定义;
-
17、忙碌转移优化,全部机器忙碌时不再直接失败;
-
18、流程任务等,透传动态参数;
-
19、任务支持切换执行器;
-
20、任务自动注册;待考虑,因为任务自动注册将会导致任务难以管理控制;
-
21、任务状态与quartz解耦,降低quartz调度压力,仅NORMAL状态任务绑定quartz;
-
22、批量触发支持,添加参数 "org.quartz.scheduler.batchTriggerAcquisitionMaxCount: 50";
## 七、其他
...
...
pom.xml
View file @
7d62145
...
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
<packaging>
pom
</packaging>
<name>
${project.artifactId}
</name>
...
...
@@ -17,6 +17,10 @@
</modules>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<maven.compiler.encoding>
UTF-8
</maven.compiler.encoding>
<javax.servlet-api.version>
3.1.0
</javax.servlet-api.version>
<javax.servlet.jsp-api.version>
2.3.3
</javax.servlet.jsp-api.version>
...
...
@@ -70,7 +74,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<version>
2.
2
</version>
<version>
2.
5
</version>
<configuration>
<archiveClasses>
false
</archiveClasses>
</configuration>
...
...
@@ -133,7 +137,7 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<version>
2.
9.1
</version>
<version>
2.
10.3
</version>
<executions>
<execution>
<phase>
package
</phase>
...
...
xxl-job-admin/Dockerfile
0 → 100644
View file @
7d62145
FROM
tomcat:8.0-jre8-slim
MAINTAINER
xuxueli
ADD
target/xxl-job-admin*.war /usr/local/tomcat/webapps/xxl-job-admin.war
CMD
["catalina.sh", "run"]
\ No newline at end of file
xxl-job-admin/pom.xml
View file @
7d62145
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<artifactId>
xxl-job-admin
</artifactId>
<packaging>
war
</packaging>
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLFU.java
View file @
7d62145
...
...
@@ -31,7 +31,7 @@ public class ExecutorRouteLFU extends ExecutorRouter {
HashMap
<
String
,
Integer
>
lfuItemMap
=
jobLfuMap
.
get
(
jobId
);
// Key排序可以用TreeMap+构造入参Compare;Value排序暂时只能通过ArrayList;
if
(
lfuItemMap
==
null
)
{
lfuItemMap
=
new
HashMap
<
String
,
Integer
>();
jobLfuMap
.
put
(
jobId
,
lfuItemMap
);
jobLfuMap
.
put
IfAbsent
(
jobId
,
lfuItemMap
);
// 避免重复覆盖
}
for
(
String
address:
addressList
)
{
if
(!
lfuItemMap
.
containsKey
(
address
)
||
lfuItemMap
.
get
(
address
)
>
1000000
)
{
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteLRU.java
View file @
7d62145
...
...
@@ -37,7 +37,7 @@ public class ExecutorRouteLRU extends ExecutorRouter {
* b、removeEldestEntry:新增元素时将会调用,返回true时会删除最老元素;可封装LinkedHashMap并重写该方法,比如定义最大容量,超出是返回true即可实现固定长度的LRU算法;
*/
lruItem
=
new
LinkedHashMap
<>(
16
,
0.75f
,
true
);
jobLRUMap
.
put
(
jobId
,
lruItem
);
jobLRUMap
.
put
IfAbsent
(
jobId
,
lruItem
);
}
// put
...
...
xxl-job-admin/src/main/resources/i18n/message.properties
View file @
7d62145
admin_name
=
任务调度中心
admin_name_full
=
分布式任务调度平台XXL-JOB
admin_version
=
1.9.2 (快照版)
admin_version
=
2.0.0-SNAPSHOT
## system
system_tips
=
系统提示
...
...
xxl-job-admin/src/main/resources/i18n/message_en.properties
View file @
7d62145
admin_name
=
Scheduling Center
admin_name_full
=
Distributed Task Scheduling Platform XXL-JOB
admin_version
=
1.9.2 (SNAPSHOT)
admin_version
=
2.0.0-SNAPSHOT
## system
system_tips
=
System message
...
...
@@ -185,7 +185,7 @@ jobgroup_field_addressType_limit=Manually registration type, the machine address
jobgroup_field_registryList
=
machine address
jobgroup_field_registryList_unvalid
=
registry machine address is illegal
jobgroup_field_registryList_placeholder
=
Please enter the machine address, if there are more than one comma separated
jobgroup_field_appName_limit
=
Limit the beginning of a lowercase letter, consists of lowercase letters、number and
underscores
.
jobgroup_field_appName_limit
=
Limit the beginning of a lowercase letter, consists of lowercase letters、number and
hyphen
.
jobgroup_field_appName_length
=
AppName length is limited to 4~64
jobgroup_field_title_length
=
Title length is limited to 4~12
jobgroup_field_order_digits
=
Please enter a positive integer
...
...
xxl-job-core/pom.xml
View file @
7d62145
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<artifactId>
xxl-job-core
</artifactId>
<packaging>
jar
</packaging>
...
...
xxl-job-executor-samples/pom.xml
View file @
7d62145
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<artifactId>
xxl-job-executor-samples
</artifactId>
<packaging>
pom
</packaging>
...
...
xxl-job-executor-samples/xxl-job-executor-sample-jfinal/pom.xml
View file @
7d62145
...
...
@@ -5,7 +5,7 @@
<parent>
<artifactId>
xxl-job-executor-samples
</artifactId>
<groupId>
com.xuxueli
</groupId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
xxl-job-executor-sample-jfinal
</artifactId>
...
...
xxl-job-executor-samples/xxl-job-executor-sample-nutz/pom.xml
View file @
7d62145
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-executor-samples
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
xxl-job-executor-sample-nutz
</artifactId>
...
...
xxl-job-executor-samples/xxl-job-executor-sample-spring/pom.xml
View file @
7d62145
...
...
@@ -4,7 +4,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-executor-samples
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<artifactId>
xxl-job-executor-sample-spring
</artifactId>
<packaging>
war
</packaging>
...
...
xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml
View file @
7d62145
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-executor-samples
</artifactId>
<version>
1.9.2
-SNAPSHOT
</version>
<version>
2.0.0
-SNAPSHOT
</version>
</parent>
<artifactId>
xxl-job-executor-sample-springboot
</artifactId>
<packaging>
jar
</packaging>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment