diff --git a/README.md b/README.md
index 340478e9..50c1067a 100644
--- a/README.md
+++ b/README.md
@@ -443,7 +443,7 @@ XXL-JOB是一个分布式任务调度平台,其核心设计目标是开发迅
- 319、深圳市姜科网络有限公司
- 320、青岛日日顺物流有限公司
- 321、南京太川信息技术有限公司
- - 322、美图之家科技优先公司【美图】
+ - 322、美图之家科技有限公司【美图】
- 323、南京太川信息技术有限公司
- 324、众薪科技(北京)有限公司
- 325、武汉安安物联科技有限公司
@@ -568,6 +568,77 @@ XXL-JOB是一个分布式任务调度平台,其核心设计目标是开发迅
- 444、上海金仕达软件科技有限公司
- 445、深圳易世通达科技有限公司
- 446、爱动超越人工智能科技(北京)有限责任公司
+ - 447、迪普信(北京)科技有限公司
+ - 448、掌站科技(北京)有限公司
+ - 449、深圳市华云中盛股份有限公司
+ - 450、上海原圈科技有限公司
+ - 451、广州赞赏信息科技有限公司
+ - 452、Amber Group
+ - 453、德威国际货运代理(上海)公司
+ - 454、浙江杰夫兄弟智慧科技有限公司
+ - 455、信也科技
+ - 456、开思时代科技(深圳)有限公司
+ - 457、大连槐德科技有限公司
+ - 458、同程生活
+ - 459、松果出行
+ - 460、企鹅杏仁集团
+ - 461、宁波科云信息科技有限公司
+ - 462、上海格蓝威驰信息科技有限公司
+ - 463、杭州趣淘鲸科技有限公司
+ - 464、湖州市数字惠民科技有限公司
+ - 465、乐普(北京)医疗器械股份有限公司
+ - 466、广州市晴川高新技术开发有限公司
+ - 467、山西缇客科技有限公司
+ - 468、徐州卡西穆电子商务有限公司
+ - 469、格创东智科技有限公司
+ - 470、世纪龙信息网络有限责任公司
+ - 471、邦道科技有限公司
+ - 472、河南中盟新云科技股份有限公司
+ - 473、横琴人寿保险有限公司
+ - 474、上海海隆华钟信息技术有限公司
+ - 475、上海久湛
+ - 476、上海仙豆智能机器人有限公司
+ - 477、广州汇尚网络科技有限公司
+ - 478、深圳市阿卡索资讯股份有限公司
+ - 479、青岛佳家康健康管理有限责任公司
+ - 480、蓝城兄弟
+ - 481、成都天府通金融服务股份有限公司
+ - 482、深圳云镖网络科技有限公司
+ - 483、上海影创科技
+ - 484、成都艾拉物联
+ - 485、北京客邻尚品网络技术有限公司
+ - 486、IT实战联盟
+ - 487、杭州尤拉夫科技有限公司
+ - 488、中大检测(湖南)股份有限公司
+ - 489、江苏电老虎工业互联网股份有限公司
+ - 490、上海助通信息科技有限公司
+ - 491、北京符节科技有限公司
+ - 492、杭州英祐科技有限公司
+ - 493、江苏电老虎工业互联网股份有限公司
+ - 494、深圳市点猫科技有限公司
+ - 495、杭州天音
+ - 496、深圳市二十一科技互联网有限公司
+ - 497、海南海口翎度科技
+ - 498、北京小趣智品科技有限公司
+ - 499、广州石竹计算机软件有限公司
+ - 500、深圳市惟客数据科技有限公司
+ - 501、中国医疗器械有限公司
+ - 502、上海云谦科技有限公司
+ - 503、上海磐农信息科技有限公司
+ - 504、广州领航食品有限公司
+ - 505、青岛掌讯通区块链科技有限公司
+ - 506、北京新网数码信息技术有限公司
+ - 507、超体信息科技(深圳)有限公司
+ - 508、长沙店帮手信息科技有限公司
+ - 509、上海助弓装饰工程有限公司
+ - 510、杭州寻联网络科技有限公司
+ - 511、成都大淘客科技有限公司
+ - 512、松果出行
+ - 513、深圳市唤梦科技有限公司
+ - 514、上汽集团商用车技术中心
+ - 515、北京中航讯科技股份有限公司
+ - 516、北龙中网(北京)科技有限责任公司
+ - 517、前海超级前台(深圳)信息技术有限公司
- ……
> 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
@@ -587,7 +658,7 @@ This product is open source and free, and will continue to provide free communit
- Licensed under the GNU General Public License (GPL) v3.
- Copyright (c) 2015-present, xuxueli.
-产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。
+产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。如有需要可邮件联系作者免费获取项目授权。
## Donate
diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md
index 0fd435d5..621c467f 100644
--- a/doc/XXL-JOB官方文档.md
+++ b/doc/XXL-JOB官方文档.md
@@ -538,7 +538,78 @@ XXL-JOB是一个分布式任务调度平台,其核心设计目标是开发迅
- 444、上海金仕达软件科技有限公司
- 445、深圳易世通达科技有限公司
- 446、爱动超越人工智能科技(北京)有限责任公司
- - ……
+ - 447、迪普信(北京)科技有限公司
+ - 448、掌站科技(北京)有限公司
+ - 449、深圳市华云中盛股份有限公司
+ - 450、上海原圈科技有限公司
+ - 451、广州赞赏信息科技有限公司
+ - 452、Amber Group
+ - 453、德威国际货运代理(上海)公司
+ - 454、浙江杰夫兄弟智慧科技有限公司
+ - 455、信也科技
+ - 456、开思时代科技(深圳)有限公司
+ - 457、大连槐德科技有限公司
+ - 458、同程生活
+ - 459、松果出行
+ - 460、企鹅杏仁集团
+ - 461、宁波科云信息科技有限公司
+ - 462、上海格蓝威驰信息科技有限公司
+ - 463、杭州趣淘鲸科技有限公司
+ - 464、湖州市数字惠民科技有限公司
+ - 465、乐普(北京)医疗器械股份有限公司
+ - 466、广州市晴川高新技术开发有限公司
+ - 467、山西缇客科技有限公司
+ - 468、徐州卡西穆电子商务有限公司
+ - 469、格创东智科技有限公司
+ - 470、世纪龙信息网络有限责任公司
+ - 471、邦道科技有限公司
+ - 472、河南中盟新云科技股份有限公司
+ - 473、横琴人寿保险有限公司
+ - 474、上海海隆华钟信息技术有限公司
+ - 475、上海久湛
+ - 476、上海仙豆智能机器人有限公司
+ - 477、广州汇尚网络科技有限公司
+ - 478、深圳市阿卡索资讯股份有限公司
+ - 479、青岛佳家康健康管理有限责任公司
+ - 480、蓝城兄弟
+ - 481、成都天府通金融服务股份有限公司
+ - 482、深圳云镖网络科技有限公司
+ - 483、上海影创科技
+ - 484、成都艾拉物联
+ - 485、北京客邻尚品网络技术有限公司
+ - 486、IT实战联盟
+ - 487、杭州尤拉夫科技有限公司
+ - 488、中大检测(湖南)股份有限公司
+ - 489、江苏电老虎工业互联网股份有限公司
+ - 490、上海助通信息科技有限公司
+ - 491、北京符节科技有限公司
+ - 492、杭州英祐科技有限公司
+ - 493、江苏电老虎工业互联网股份有限公司
+ - 494、深圳市点猫科技有限公司
+ - 495、杭州天音
+ - 496、深圳市二十一科技互联网有限公司
+ - 497、海南海口翎度科技
+ - 498、北京小趣智品科技有限公司
+ - 499、广州石竹计算机软件有限公司
+ - 500、深圳市惟客数据科技有限公司
+ - 501、中国医疗器械有限公司
+ - 502、上海云谦科技有限公司
+ - 503、上海磐农信息科技有限公司
+ - 504、广州领航食品有限公司
+ - 505、青岛掌讯通区块链科技有限公司
+ - 506、北京新网数码信息技术有限公司
+ - 507、超体信息科技(深圳)有限公司
+ - 508、长沙店帮手信息科技有限公司
+ - 509、上海助弓装饰工程有限公司
+ - 510、杭州寻联网络科技有限公司
+ - 511、成都大淘客科技有限公司
+ - 512、松果出行
+ - 513、深圳市唤梦科技有限公司
+ - 514、上汽集团商用车技术中心
+ - 515、北京中航讯科技股份有限公司
+ - 516、北龙中网(北京)科技有限责任公司
+ - 517、前海超级前台(深圳)信息技术有限公司
+ - ……
> 更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
@@ -2136,19 +2207,24 @@ public void execute() {
- 26、【修复】页面redirect跳转后https变为http问题修复;
- 27、【修复】执行器日志清理优化,修复小概率下日志文件为空导致清理异常问题;
-
-### 7.32 版本 v2.4.0 Release Notes[规划中]
+### 7.32 版本 v2.3.1 Release Notes[规划中]
- 1、【优化】[规划中]任务日志重构:一次调度只记录一条主任务,维护起止时间和状态。
- 普通任务:只记录一条主任务;
- 广播任务:记录一条主任务,每个分片任务记录一条次任务,关联在主任务上;
- 重试任务:失败时,新增主任务。所有调度记录,包括入口调度和重试调度,均挂载主任务上。
- 2、【优化】[规划中]分片任务:全部完成后才会出发后置节点;
-- 3、[规划中]DAG流程任务
+- 3、【优化】多个项目依赖升级至较新稳定版本,如netty、groovy、spring、springboot等;
+- 4、【优化】合并多项PR:代码结构、代码变量和注释等多项优化调整;
+- 5、【优化】任务线程名优化(ISSUE-2527)
+- 6、【修复】邮箱校验逻辑下放至EmailJobAlarm中,避免对其他告警方式的干扰;
+
+### 7.33 版本 v2.4.0 Release Notes[规划中]
+- 1、[规划中]DAG流程任务
- DAG任务:支持参数传递,共享数据:DAG任务创建、管理,DAG任务日志查看、操作;
- 子任务:废弃
-- 4、[规划中]多数据库支持,DAO层通过JPA实现,不限制数据库类型;
-- 5、[规划中]告警增强:邮件告警 + webhook告警;
-- 6、[规划中]安全强化:AccessToken动态生成、动态启停;控制调度、回调;
+- 2、[规划中]多数据库支持,DAO层通过JPA实现,不限制数据库类型;
+- 3、[规划中]告警增强:邮件告警 + webhook告警;
+- 4、[规划中]安全强化:AccessToken动态生成、动态启停;控制调度、回调;
### TODO LIST
- 1、任务分片路由:分片采用一致性Hash算法计算出尽量稳定的分片顺序,即使注册机器存在波动也不会引起分批分片顺序大的波动;目前采用IP自然排序,可以满足需求,待定;
@@ -2193,7 +2269,7 @@ public void execute() {
更多接入的公司,欢迎在 [登记地址](https://github.com/xuxueli/xxl-job/issues/1 ) 登记,登记仅仅为了产品推广。
### 8.3 开源协议和版权
-产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。
+产品开源免费,并且将持续提供免费的社区技术支持。个人或企业内部可自由的接入和使用。如有需要可邮件联系作者免费获取项目授权。
- Licensed under the GNU General Public License (GPL) v3.
- Copyright (c) 2015-present, xuxueli.
diff --git a/doc/db/tables_xxl_job.sql b/doc/db/tables_xxl_job.sql
index 02e4442a..31b895b2 100644
--- a/doc/db/tables_xxl_job.sql
+++ b/doc/db/tables_xxl_job.sql
@@ -1,5 +1,5 @@
#
-# XXL-JOB v2.3.0
+# XXL-JOB v2.3.1-SNAPSHOT
# Copyright (c) 2015-present, xuxueli.
CREATE database if NOT EXISTS `xxl_job` default character set utf8mb4 collate utf8mb4_unicode_ci;
@@ -21,6 +21,7 @@ CREATE TABLE `xxl_job_info` (
`executor_route_strategy` varchar(50) DEFAULT NULL COMMENT '执行器路由策略',
`executor_handler` varchar(255) DEFAULT NULL COMMENT '执行器任务handler',
`executor_param` varchar(512) DEFAULT NULL COMMENT '执行器任务参数',
+ `sharding_param` text DEFAULT NULL COMMENT '执行器分片参数',
`executor_block_strategy` varchar(50) DEFAULT NULL COMMENT '阻塞处理策略',
`executor_timeout` int(11) NOT NULL DEFAULT '0' COMMENT '任务执行超时时间,单位秒',
`executor_fail_retry_count` int(11) NOT NULL DEFAULT '0' COMMENT '失败重试次数',
diff --git a/pom.xml b/pom.xml
index ac599310..f60aa5c1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.xuxueli
xxl-job
- 2.3.0
+ 2.3.1-SNAPSHOT
pom
${project.artifactId}
@@ -24,20 +24,20 @@
1.8
true
- 4.1.58.Final
+ 4.1.63.Final
2.8.6
- 5.3.3
- 2.4.2
+ 5.3.6
+ 2.4.5
2.1.4
- 8.0.23
+ 8.0.24
1.7.30
- 5.7.1
+ 5.7.1
1.3.2
- 3.0.7
+ 3.0.8
3.2.1
3.2.0
diff --git a/xxl-job-admin/pom.xml b/xxl-job-admin/pom.xml
index cd4bcf23..5ff4f5c8 100644
--- a/xxl-job-admin/pom.xml
+++ b/xxl-job-admin/pom.xml
@@ -4,7 +4,7 @@
com.xuxueli
xxl-job
- 2.3.0
+ 2.3.1-SNAPSHOT
xxl-job-admin
jar
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
index e7290d76..16e52184 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/alarm/impl/EmailJobAlarm.java
@@ -32,6 +32,7 @@ public class EmailJobAlarm implements JobAlarm {
*
* @param jobLog
*/
+ @Override
public boolean doAlarm(XxlJobInfo info, XxlJobLog jobLog){
boolean alarmResult = true;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
index b9ac59a3..279ad7d1 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/complete/XxlJobCompleter.java
@@ -47,7 +47,7 @@ public class XxlJobCompleter {
// 1、handle success, to trigger child job
String triggerChildMsg = null;
- if (XxlJobContext.HANDLE_COCE_SUCCESS == xxlJobLog.getHandleCode()) {
+ if (XxlJobContext.HANDLE_CODE_SUCCESS == xxlJobLog.getHandleCode()) {
XxlJobInfo xxlJobInfo = XxlJobAdminConfig.getAdminConfig().getXxlJobInfoDao().loadById(xxlJobLog.getJobId());
if (xxlJobInfo!=null && xxlJobInfo.getChildJobId()!=null && xxlJobInfo.getChildJobId().trim().length()>0) {
triggerChildMsg = "
>>>>>>>>>>>"+ I18nUtil.getString("jobconf_trigger_child_run") +"<<<<<<<<<<<
";
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobInfo.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobInfo.java
index e47b6dc6..8be56ad0 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobInfo.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/model/XxlJobInfo.java
@@ -27,6 +27,7 @@ public class XxlJobInfo {
private String executorRouteStrategy; // 执行器路由策略
private String executorHandler; // 执行器,任务Handler名称
private String executorParam; // 执行器,任务参数
+ private String shardingParam; // 执行器,分片参数
private String executorBlockStrategy; // 阻塞处理策略
private int executorTimeout; // 任务执行超时时间,单位秒
private int executorFailRetryCount; // 失败重试次数
@@ -42,7 +43,6 @@ public class XxlJobInfo {
private long triggerLastTime; // 上次调度时间
private long triggerNextTime; // 下次调度时间
-
public int getId() {
return id;
}
@@ -147,6 +147,14 @@ public class XxlJobInfo {
this.executorParam = executorParam;
}
+ public String getShardingParam() {
+ return shardingParam;
+ }
+
+ public void setShardingParam(String shardingParam) {
+ this.shardingParam = shardingParam;
+ }
+
public String getExecutorBlockStrategy() {
return executorBlockStrategy;
}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouteStrategyEnum.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouteStrategyEnum.java
index 7fff93a9..f101d65c 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouteStrategyEnum.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/ExecutorRouteStrategyEnum.java
@@ -17,7 +17,7 @@ public enum ExecutorRouteStrategyEnum {
LEAST_RECENTLY_USED(I18nUtil.getString("jobconf_route_lru"), new ExecutorRouteLRU()),
FAILOVER(I18nUtil.getString("jobconf_route_failover"), new ExecutorRouteFailover()),
BUSYOVER(I18nUtil.getString("jobconf_route_busyover"), new ExecutorRouteBusyover()),
- SHARDING_BROADCAST(I18nUtil.getString("jobconf_route_shard"), null);
+ SHARDING_BROADCAST(I18nUtil.getString("jobconf_route_shard"), new ExecutorRouteSharding());
ExecutorRouteStrategyEnum(String title, ExecutorRouter router) {
this.title = title;
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteSharding.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteSharding.java
new file mode 100644
index 00000000..6becbfc6
--- /dev/null
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteSharding.java
@@ -0,0 +1,23 @@
+package com.xxl.job.admin.core.route.strategy;
+
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.biz.model.TriggerParam;
+
+import java.util.List;
+
+/**
+ *
+ * 分片规则的-路由器-直接采取的是随机路由算法
+ *
+ *
+ * @author daiqi
+ * @since 2022/5/8 18:23
+ */
+public class ExecutorRouteSharding extends ExecutorRouteBusyover {
+
+ @Override
+ public ReturnT route(TriggerParam triggerParam, List addressList) {
+ return super.route(triggerParam, addressList);
+ }
+
+}
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
index 33e4d250..8409d7b3 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
@@ -60,7 +60,7 @@ public class JobFailMonitorHelper {
// 2、fail alarm monitor
int newAlarmStatus = 0; // 告警状态:0-默认、-1=锁定状态、1-无需告警、2-告警成功、3-告警失败
- if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
+ if (info != null) {
boolean alarmResult = XxlJobAdminConfig.getAdminConfig().getJobAlarmer().alarm(info, log);
newAlarmStatus = alarmResult?2:3;
} else {
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
index 748befc6..65aedd66 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java
@@ -13,10 +13,12 @@ import com.xxl.job.core.biz.model.TriggerParam;
import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.util.IpUtil;
import com.xxl.job.core.util.ThrowableUtil;
+import io.netty.util.internal.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;
+import java.util.List;
/**
* xxl-job trigger
@@ -79,8 +81,9 @@ public class XxlJobTrigger {
if (ExecutorRouteStrategyEnum.SHARDING_BROADCAST==ExecutorRouteStrategyEnum.match(jobInfo.getExecutorRouteStrategy(), null)
&& group.getRegistryList()!=null && !group.getRegistryList().isEmpty()
&& shardingParam==null) {
- for (int i = 0; i < group.getRegistryList().size(); i++) {
- processTrigger(group, jobInfo, finalFailRetryCount, triggerType, i, group.getRegistryList().size());
+ int shardingTotal = getSharingTotal(jobInfo.getShardingParam());
+ for (int i = 0; i < shardingTotal; i++) {
+ processTrigger(group, jobInfo, finalFailRetryCount, triggerType, i, shardingTotal);
}
} else {
if (shardingParam == null) {
@@ -91,6 +94,35 @@ public class XxlJobTrigger {
}
+ private static int getSharingTotal(String executorShardingParam) {
+ if (StringUtil.isNullOrEmpty(executorShardingParam)) {
+ return 1;
+ }
+ // 获取分片的数量
+ return getShardingArr(executorShardingParam).length;
+ }
+
+ public static String getShardingParam(String shardingParams, int index) {
+ String[] shardingArr = getShardingArr(shardingParams);
+ String[] shardingParamArr = shardingArr[index].split("=");
+ if (shardingParamArr.length >= 2) {
+ return shardingParamArr[1];
+ }
+ return shardingParamArr[0];
+ }
+
+ private static String [] getShardingArr(String shardingParams) {
+ if (StringUtil.isNullOrEmpty(shardingParams)) {
+ return new String[0];
+ }
+ return shardingParams.split("/");
+ }
+
+ public static class ShardingInfo {
+ private int total;
+ private List shardingParams;
+ }
+
private static boolean isNumeric(String str){
try {
int result = Integer.valueOf(str);
@@ -113,7 +145,7 @@ public class XxlJobTrigger {
// param
ExecutorBlockStrategyEnum blockStrategy = ExecutorBlockStrategyEnum.match(jobInfo.getExecutorBlockStrategy(), ExecutorBlockStrategyEnum.SERIAL_EXECUTION); // block strategy
ExecutorRouteStrategyEnum executorRouteStrategyEnum = ExecutorRouteStrategyEnum.match(jobInfo.getExecutorRouteStrategy(), null); // route strategy
- String shardingParam = (ExecutorRouteStrategyEnum.SHARDING_BROADCAST==executorRouteStrategyEnum)?String.valueOf(index).concat("/").concat(String.valueOf(total)):null;
+ String shardingParam = (ExecutorRouteStrategyEnum.SHARDING_BROADCAST==executorRouteStrategyEnum)?getShardingParam(jobInfo.getShardingParam(), index):null;
// 1、save log-id
XxlJobLog jobLog = new XxlJobLog();
@@ -128,6 +160,7 @@ public class XxlJobTrigger {
triggerParam.setJobId(jobInfo.getId());
triggerParam.setExecutorHandler(jobInfo.getExecutorHandler());
triggerParam.setExecutorParams(jobInfo.getExecutorParam());
+ triggerParam.setShardingParam(shardingParam);
triggerParam.setExecutorBlockStrategy(jobInfo.getExecutorBlockStrategy());
triggerParam.setExecutorTimeout(jobInfo.getExecutorTimeout());
triggerParam.setLogId(jobLog.getId());
@@ -142,17 +175,9 @@ public class XxlJobTrigger {
String address = null;
ReturnT routeAddressResult = null;
if (group.getRegistryList()!=null && !group.getRegistryList().isEmpty()) {
- if (ExecutorRouteStrategyEnum.SHARDING_BROADCAST == executorRouteStrategyEnum) {
- if (index < group.getRegistryList().size()) {
- address = group.getRegistryList().get(index);
- } else {
- address = group.getRegistryList().get(0);
- }
- } else {
- routeAddressResult = executorRouteStrategyEnum.getRouter().route(triggerParam, group.getRegistryList());
- if (routeAddressResult.getCode() == ReturnT.SUCCESS_CODE) {
- address = routeAddressResult.getContent();
- }
+ routeAddressResult = executorRouteStrategyEnum.getRouter().route(triggerParam, group.getRegistryList());
+ if (routeAddressResult.getCode() == ReturnT.SUCCESS_CODE) {
+ address = routeAddressResult.getContent();
}
} else {
routeAddressResult = new ReturnT(ReturnT.FAIL_CODE, I18nUtil.getString("jobconf_trigger_address_empty"));
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
index 530ee41c..f7d1fb0a 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
@@ -274,6 +274,7 @@ public class XxlJobServiceImpl implements XxlJobService {
exists_jobInfo.setExecutorRouteStrategy(jobInfo.getExecutorRouteStrategy());
exists_jobInfo.setExecutorHandler(jobInfo.getExecutorHandler());
exists_jobInfo.setExecutorParam(jobInfo.getExecutorParam());
+ exists_jobInfo.setShardingParam(jobInfo.getShardingParam());
exists_jobInfo.setExecutorBlockStrategy(jobInfo.getExecutorBlockStrategy());
exists_jobInfo.setExecutorTimeout(jobInfo.getExecutorTimeout());
exists_jobInfo.setExecutorFailRetryCount(jobInfo.getExecutorFailRetryCount());
diff --git a/xxl-job-admin/src/main/resources/application.properties b/xxl-job-admin/src/main/resources/application.properties
index afe93b42..1789e6c8 100644
--- a/xxl-job-admin/src/main/resources/application.properties
+++ b/xxl-job-admin/src/main/resources/application.properties
@@ -25,7 +25,7 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
### xxl-job, datasource
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
spring.datasource.username=root
-spring.datasource.password=root_pwd
+spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
### datasource-pool
diff --git a/xxl-job-admin/src/main/resources/i18n/message_en.properties b/xxl-job-admin/src/main/resources/i18n/message_en.properties
index 8e7d8352..1408355a 100644
--- a/xxl-job-admin/src/main/resources/i18n/message_en.properties
+++ b/xxl-job-admin/src/main/resources/i18n/message_en.properties
@@ -1,6 +1,6 @@
admin_name=Scheduling Center
admin_name_full=Distributed Task Scheduling Platform XXL-JOB
-admin_version=2.3.0
+admin_version=2.3.1-SNAPSHOT
admin_i18n=en
## system
@@ -117,6 +117,7 @@ jobinfo_field_jobdesc=Job description
jobinfo_field_timeout=Job timeout period
jobinfo_field_gluetype=GLUE Type
jobinfo_field_executorparam=Param
+jobinfo_field_shardingparam=Sharding Param
jobinfo_field_author=Author
jobinfo_field_alarmemail=Alarm email
jobinfo_field_alarmemail_placeholder=Please enter alarm mail, if there are more than one comma separated
@@ -221,6 +222,7 @@ jobgroup_empty=There is no valid executor. Please contact the administrator
## job conf
jobconf_block_SERIAL_EXECUTION=Serial execution
+jobconf_block_CONCURRENT_EXECUTION=Concurrent execution
jobconf_block_DISCARD_LATER=Discard Later
jobconf_block_COVER_EARLY=Cover Early
jobconf_route_first=First
diff --git a/xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties b/xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties
index 00ca50e1..e8edbdcc 100644
--- a/xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties
+++ b/xxl-job-admin/src/main/resources/i18n/message_zh_CN.properties
@@ -1,6 +1,6 @@
admin_name=任务调度中心
admin_name_full=分布式任务调度平台XXL-JOB
-admin_version=2.3.0
+admin_version=2.3.1-SNAPSHOT
admin_i18n=
## system
@@ -116,6 +116,7 @@ jobinfo_field_jobgroup=执行器
jobinfo_field_jobdesc=任务描述
jobinfo_field_gluetype=运行模式
jobinfo_field_executorparam=任务参数
+jobinfo_field_shardingparam=任务分片参数
jobinfo_field_author=负责人
jobinfo_field_timeout=任务超时时间
jobinfo_field_alarmemail=报警邮件
@@ -221,6 +222,7 @@ jobgroup_empty=不存在有效执行器,请联系管理员
## job conf
jobconf_block_SERIAL_EXECUTION=单机串行
+jobconf_block_CONCURRENT_EXECUTION=单机并行
jobconf_block_DISCARD_LATER=丢弃后续调度
jobconf_block_COVER_EARLY=覆盖之前调度
jobconf_route_first=第一个
diff --git a/xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties b/xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties
index 90bfc1aa..f98eb649 100755
--- a/xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties
+++ b/xxl-job-admin/src/main/resources/i18n/message_zh_TC.properties
@@ -1,6 +1,6 @@
admin_name=任務調度中心
admin_name_full=分布式任務調度平臺XXL-JOB
-admin_version=2.3.0
+admin_version=2.3.1-SNAPSHOT
admin_i18n=
## system
@@ -116,6 +116,7 @@ jobinfo_field_jobgroup=執行器
jobinfo_field_jobdesc=任務描述
jobinfo_field_gluetype=運行模式
jobinfo_field_executorparam=任務參數
+jobinfo_field_shardingparam=分片參數
jobinfo_field_author=負責人
jobinfo_field_timeout=任務超時秒數
jobinfo_field_alarmemail=告警郵件
@@ -221,6 +222,7 @@ jobgroup_empty=不存在有效執行器,請聯絡系統管理員
## job conf
jobconf_block_SERIAL_EXECUTION=單機串行
+jobconf_block_CONCURRENT_EXECUTION=单机并行
jobconf_block_DISCARD_LATER=丢棄后續調度
jobconf_block_COVER_EARLY=覆蓋之前調度
jobconf_route_first=第一個
diff --git a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
index 7b3c3a3e..6968d250 100644
--- a/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
+++ b/xxl-job-admin/src/main/resources/mybatis-mapper/XxlJobInfoMapper.xml
@@ -22,6 +22,7 @@
+
@@ -52,6 +53,7 @@
t.executor_route_strategy,
t.executor_handler,
t.executor_param,
+ t.sharding_param,
t.executor_block_strategy,
t.executor_timeout,
t.executor_fail_retry_count,
@@ -125,6 +127,7 @@
executor_route_strategy,
executor_handler,
executor_param,
+ sharding_param,
executor_block_strategy,
executor_timeout,
executor_fail_retry_count,
@@ -149,6 +152,7 @@
#{executorRouteStrategy},
#{executorHandler},
#{executorParam},
+ #{shardingParam},
#{executorBlockStrategy},
#{executorTimeout},
#{executorFailRetryCount},
@@ -187,6 +191,7 @@
executor_route_strategy = #{executorRouteStrategy},
executor_handler = #{executorHandler},
executor_param = #{executorParam},
+ sharding_param = #{shardingParam},
executor_block_strategy = #{executorBlockStrategy},
executor_timeout = ${executorTimeout},
executor_fail_retry_count = ${executorFailRetryCount},
diff --git a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
index b479e972..8a472ec6 100644
--- a/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
+++ b/xxl-job-admin/src/main/resources/static/js/jobinfo.index.1.js
@@ -74,6 +74,7 @@ $(function() {
}
},
{ "data": 'executorParam', "visible" : false},
+ { "data": 'shardingParam', "visible" : false},
{
"data": 'addTime',
"visible" : false,
@@ -266,6 +267,7 @@ $(function() {
$("#jobTriggerModal .form input[name='id']").val( row.id );
$("#jobTriggerModal .form textarea[name='executorParam']").val( row.executorParam );
+ $("#jobTriggerModal .form textarea[name='shardingParam']").val( row.shardingParam );
$('#jobTriggerModal').modal({backdrop: false, keyboard: false}).modal('show');
});
@@ -276,6 +278,7 @@ $(function() {
data : {
"id" : $("#jobTriggerModal .form input[name='id']").val(),
"executorParam" : $("#jobTriggerModal .textarea[name='executorParam']").val(),
+ "shardingParam" : $("#jobTriggerModal .textarea[name='shardingParam']").val(),
"addressList" : $("#jobTriggerModal .textarea[name='addressList']").val()
},
dataType : "json",
@@ -561,6 +564,7 @@ $(function() {
$('#updateModal .form select[name=glueType] option[value='+ row.glueType +']').prop('selected', true);
$("#updateModal .form input[name='executorHandler']").val( row.executorHandler );
$("#updateModal .form textarea[name='executorParam']").val( row.executorParam );
+ $("#updateModal .form textarea[name='shardingParam']").val( row.shardingParam );
// 》init glueType
$("#updateModal .form select[name=glueType]").change();
@@ -716,6 +720,7 @@ $(function() {
$('#addModal .form select[name=glueType] option[value='+ row.glueType +']').prop('selected', true);
$("#addModal .form input[name='executorHandler']").val( row.executorHandler );
$("#addModal .form textarea[name='executorParam']").val( row.executorParam );
+ $("#addModal .form textarea[name='shardingParam']").val( row.shardingParam );
// 》init glueType
$("#addModal .form select[name=glueType]").change();
diff --git a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
index 3a5d7d8a..91ccf13a 100644
--- a/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
+++ b/xxl-job-admin/src/main/resources/templates/jobinfo/jobinfo.index.ftl
@@ -83,6 +83,7 @@
${I18n.schedule_type} |
${I18n.jobinfo_field_gluetype} |
${I18n.jobinfo_field_executorparam} |
+ ${I18n.jobinfo_field_shardingparam} |
addTime |
updateTime |
${I18n.jobinfo_field_author} |
@@ -188,6 +189,13 @@
+
+
${I18n.jobinfo_conf_advanced}
<#-- 高级配置 -->
@@ -265,6 +273,7 @@ echo "${I18n.jobinfo_script_location}:$0"
echo "${I18n.jobinfo_field_executorparam}:$1"
echo "${I18n.jobinfo_shard_index} = $2"
echo "${I18n.jobinfo_shard_total} = $3"
+echo "${I18n.jobinfo_field_shardingparam}:$4"
<#--echo "参数数量:$#"
for param in $*
do
@@ -287,6 +296,7 @@ print "${I18n.jobinfo_script_location}:", sys.argv[0]
print "${I18n.jobinfo_field_executorparam}:", sys.argv[1]
print "${I18n.jobinfo_shard_index}:", sys.argv[2]
print "${I18n.jobinfo_shard_total}:", sys.argv[3]
+print "${I18n.jobinfo_field_shardingparam}:", sys.argv[4]
<#--for i in range(1, len(sys.argv)):
time.sleep(1)
print "参数", i, sys.argv[i]-->
@@ -309,6 +319,7 @@ logging.info("脚本文件:" + sys.argv[0])
echo "${I18n.jobinfo_field_executorparam}:$argv[1] \n";
echo "${I18n.jobinfo_shard_index} = $argv[2] \n";
echo "${I18n.jobinfo_shard_total} = $argv[3] \n";
+ echo "${I18n.jobinfo_field_shardingparam} = $argv[4] \n";
echo "Good bye! \n";
exit(0);
@@ -433,6 +444,13 @@ exit 0
+
+
${I18n.jobinfo_conf_advanced}
<#-- 高级配置 -->
@@ -507,6 +525,12 @@ exit 0
+