任务触发组件加载顺序调整,避免小概率情况下组件随机加载顺序导致的I18N的NPE问题;

master
xuxueli 5 years ago
parent 0991c1d372
commit 97625a6785
  1. 2
      doc/XXL-JOB官方文档.md
  2. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobApiController.java
  3. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java
  4. 27
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminBean
  5. 27
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/conf/XxlJobAdminConfig.java
  6. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteBusyover.java
  7. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/route/strategy/ExecutorRouteFailover.java
  8. 8
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/scheduler/XxlJobScheduler.java
  9. 2
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/trigger/XxlJobTrigger.java

@ -1573,7 +1573,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 6、调度组件优化:针对永远不会触发的Cron禁止配置和启动;任务Cron最后一次触发后再也不会触发时,比如一次性任务,主动停止相关任务;
- 7、任务列表交互优化,支持查看任务所属执行器的注册节点;
- 8、DB重连优化,修复DB宕机重连后任务调度停止的问题,重连后自动加入调度集群触发任务调度;
- 9、任务触发组件加载顺序调整,避免小概率情况下组件随机加载顺序导致的I18N的NPE问题
- 9、任务触发组件加载顺序调整,避免小概率情况下组件随机加载顺序导致的I18N的NPE问题;
- 10、项目依赖升级至较新稳定版本,如spring、spring-boot、mybatis、slf4j、groovy等等;
- 11、JobThread自销毁优化,避免并发触发导致triggerQueue中任务丢失问题;
- 12、[ING,交互兼容问题待处理]Cron在线生成工具:任务新增、编辑框通过组件在线生成Cron表达式;

@ -1,7 +1,7 @@
package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermissionLimit;
import com.xxl.job.admin.core.conf.XxlJobScheduler;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.core.biz.AdminBiz;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Controller;

@ -1,6 +1,6 @@
package com.xxl.job.admin.controller;
import com.xxl.job.admin.core.conf.XxlJobScheduler;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.exception.XxlJobException;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;

@ -1,27 +0,0 @@
package com.xxl.job.admin.conf;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @Auther: zhuolin.ji
* @Date: 2019/10/12 18:08
* @Package: com.xxl.job.admin.conf
* @Description:
*/
@Configuration
public class XxlJobAdminBean {
@Bean(name = "xxlJobAdminConfig")
public XxlJobAdminConfig getXxlJobAdminConfig() {
return new XxlJobAdminConfig();
}
@Bean(initMethod = "init", destroyMethod = "destroy")
public XxlJobScheduler getXxlJobScheduler(@Qualifier(value = "xxlJobAdminConfig") XxlJobAdminConfig xxlJobAdminConfig) {
XxlJobAdminConfig.setAdminConfig(xxlJobAdminConfig);
return new XxlJobScheduler();
}
}

@ -1,10 +1,12 @@
package com.xxl.job.admin.core.conf;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.dao.XxlJobGroupDao;
import com.xxl.job.admin.dao.XxlJobInfoDao;
import com.xxl.job.admin.dao.XxlJobLogDao;
import com.xxl.job.admin.dao.XxlJobRegistryDao;
import com.xxl.job.core.biz.AdminBiz;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.mail.javamail.JavaMailSender;
@ -19,16 +21,35 @@ import javax.sql.DataSource;
* @author xuxueli 2017-04-28
*/
public class XxlJobAdminConfig {
@Component
public class XxlJobAdminConfig implements InitializingBean, DisposableBean {
private static XxlJobAdminConfig adminConfig = null;
public static XxlJobAdminConfig getAdminConfig() {
return adminConfig;
}
public static void setAdminConfig(XxlJobAdminConfig config) {
XxlJobAdminConfig.adminConfig = config;
// ---------------------- XxlJobScheduler ----------------------
private XxlJobScheduler xxlJobScheduler;
@Override
public void afterPropertiesSet() throws Exception {
adminConfig = this;
xxlJobScheduler = new XxlJobScheduler();
xxlJobScheduler.init();
}
@Override
public void destroy() throws Exception {
xxlJobScheduler.destroy();
}
// ---------------------- XxlJobScheduler ----------------------
// conf
@Value("${xxl.job.i18n}")
private String i18n;

@ -1,6 +1,6 @@
package com.xxl.job.admin.core.route.strategy;
import com.xxl.job.admin.core.conf.XxlJobScheduler;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.route.ExecutorRouter;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.ExecutorBiz;

@ -1,6 +1,6 @@
package com.xxl.job.admin.core.route.strategy;
import com.xxl.job.admin.core.conf.XxlJobScheduler;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.route.ExecutorRouter;
import com.xxl.job.admin.core.util.I18nUtil;
import com.xxl.job.core.biz.ExecutorBiz;

@ -1,5 +1,6 @@
package com.xxl.job.admin.core.conf;
package com.xxl.job.admin.core.scheduler;
import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
import com.xxl.job.admin.core.thread.JobFailMonitorHelper;
import com.xxl.job.admin.core.thread.JobRegistryMonitorHelper;
import com.xxl.job.admin.core.thread.JobScheduleHelper;
@ -18,10 +19,6 @@ import com.xxl.rpc.remoting.provider.XxlRpcProviderFactory;
import com.xxl.rpc.serialize.Serializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@ -38,7 +35,6 @@ public class XxlJobScheduler {
private static final Logger logger = LoggerFactory.getLogger(XxlJobScheduler.class);
public void init() throws Exception {
// init i18n
initI18n();

@ -1,7 +1,7 @@
package com.xxl.job.admin.core.trigger;
import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
import com.xxl.job.admin.core.conf.XxlJobScheduler;
import com.xxl.job.admin.core.scheduler.XxlJobScheduler;
import com.xxl.job.admin.core.model.XxlJobGroup;
import com.xxl.job.admin.core.model.XxlJobInfo;
import com.xxl.job.admin.core.model.XxlJobLog;

Loading…
Cancel
Save