diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md
index 3c4f6f49..b9c17dca 100644
--- a/doc/XXL-JOB官方文档.md
+++ b/doc/XXL-JOB官方文档.md
@@ -1396,7 +1396,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 1、调度中心告警邮件发送组件改为 “spring-boot-starter-mail”;
- 2、任务告警逻辑调整,改为通过扫描失败日志方式触发。一方面精确扫描失败任务,降低扫描范围;另一方面取消内存队列,降低线程内存消耗;
- 3、记住密码功能优化,选中时永久记住;非选中时关闭浏览器即登出;
-- 4、项目依赖升级至较新稳定版本,如spring、jackson、groovy等等;
+- 4、项目依赖升级至较新稳定版本,如spring、jackson、groovy、xxl-rpc等等;
- 5、精简项目,取消第三方依赖,如 commons-collections4 ;
- [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁;
- [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容;
diff --git a/pom.xml b/pom.xml
index bb1e67d7..ab3aff5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,8 @@
1.7
true
- 1.2.1
+ 1.3.1
+ 9.2.26.v20180806
1.5.18.RELEASE
1.3.2
@@ -42,7 +43,6 @@
2.3.0
2.9.8
- 9.2.26.v20180806
diff --git a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
index 3161c739..e9fba260 100644
--- a/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
+++ b/xxl-job-admin/src/main/java/com/xxl/job/admin/core/schedule/XxlJobDynamicScheduler.java
@@ -13,6 +13,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory;
import com.xxl.rpc.remoting.invoker.call.CallType;
import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean;
+import com.xxl.rpc.remoting.invoker.route.LoadBalance;
import com.xxl.rpc.remoting.net.NetEnum;
import com.xxl.rpc.remoting.net.impl.jetty.server.JettyServerHandler;
import com.xxl.rpc.remoting.provider.XxlRpcProviderFactory;
@@ -98,7 +99,14 @@ public final class XxlJobDynamicScheduler {
private void initRpcProvider(){
// init
XxlRpcProviderFactory xxlRpcProviderFactory = new XxlRpcProviderFactory();
- xxlRpcProviderFactory.initConfig(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), null, 0, XxlJobAdminConfig.getAdminConfig().getAccessToken(), null, null);
+ xxlRpcProviderFactory.initConfig(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ null,
+ 0,
+ XxlJobAdminConfig.getAdminConfig().getAccessToken(),
+ null,
+ null);
// add services
xxlRpcProviderFactory.addService(AdminBiz.class.getName(), null, XxlJobAdminConfig.getAdminConfig().getAdminBiz());
@@ -107,7 +115,7 @@ public final class XxlJobDynamicScheduler {
jettyServerHandler = new JettyServerHandler(xxlRpcProviderFactory);
}
private void stopRpcProvider() throws Exception {
- new XxlRpcInvokerFactory().stop();
+ XxlRpcInvokerFactory.getInstance().stop();
}
public static void invokeAdminService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
jettyServerHandler.handle(null, new Request(null, null), request, response);
@@ -130,8 +138,18 @@ public final class XxlJobDynamicScheduler {
}
// set-cache
- executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC,
- ExecutorBiz.class, null, 10000, address, XxlJobAdminConfig.getAdminConfig().getAccessToken(), null).getObject();
+ executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ CallType.SYNC,
+ LoadBalance.ROUND,
+ ExecutorBiz.class,
+ null,
+ 10000,
+ address,
+ XxlJobAdminConfig.getAdminConfig().getAccessToken(),
+ null,
+ null).getObject();
executorBizRepository.put(address, executorBiz);
return executorBiz;
diff --git a/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java b/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
index 7883f6fa..45b3e15b 100644
--- a/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
+++ b/xxl-job-admin/src/test/java/com/xxl/job/adminbiz/AdminBizTest.java
@@ -6,6 +6,7 @@ import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.enums.RegistryConfig;
import com.xxl.rpc.remoting.invoker.call.CallType;
import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean;
+import com.xxl.rpc.remoting.invoker.route.LoadBalance;
import com.xxl.rpc.remoting.net.NetEnum;
import com.xxl.rpc.serialize.Serializer;
import org.junit.Assert;
@@ -30,8 +31,18 @@ public class AdminBizTest {
@Test
public void registryTest() throws Exception {
addressUrl = addressUrl.replace("http://", "");
- AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC,
- AdminBiz.class, null, 10000, addressUrl, accessToken, null).getObject();
+ AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ CallType.SYNC,
+ LoadBalance.ROUND,
+ AdminBiz.class,
+ null,
+ 10000,
+ addressUrl,
+ accessToken,
+ null,
+ null).getObject();
// test executor registry
RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), "xxl-job-executor-example", "127.0.0.1:9999");
@@ -47,8 +58,18 @@ public class AdminBizTest {
@Test
public void registryRemove() throws Exception {
addressUrl = addressUrl.replace("http://", "");
- AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC,
- AdminBiz.class, null, 10000, addressUrl, accessToken, null).getObject();
+ AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ CallType.SYNC,
+ LoadBalance.ROUND,
+ AdminBiz.class,
+ null,
+ 10000,
+ addressUrl,
+ accessToken,
+ null,
+ null).getObject();
// test executor registry remove
RegistryParam registryParam = new RegistryParam(RegistryConfig.RegistType.EXECUTOR.name(), "xxl-job-executor-example", "127.0.0.1:9999");
diff --git a/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
index bf3abab7..8ea545c5 100644
--- a/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
+++ b/xxl-job-admin/src/test/java/com/xxl/job/executor/ExecutorBizTest.java
@@ -7,6 +7,7 @@ import com.xxl.job.core.enums.ExecutorBlockStrategyEnum;
import com.xxl.job.core.glue.GlueTypeEnum;
import com.xxl.rpc.remoting.invoker.call.CallType;
import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean;
+import com.xxl.rpc.remoting.invoker.route.LoadBalance;
import com.xxl.rpc.remoting.net.NetEnum;
import com.xxl.rpc.serialize.Serializer;
@@ -47,8 +48,18 @@ public class ExecutorBizTest {
// do remote trigger
String accessToken = null;
- ExecutorBiz executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC,
- ExecutorBiz.class, null, 10000, "127.0.0.1:9999", null, null).getObject();
+ ExecutorBiz executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ CallType.SYNC,
+ LoadBalance.ROUND,
+ ExecutorBiz.class,
+ null,
+ 10000,
+ "127.0.0.1:9999",
+ null,
+ null,
+ null).getObject();
ReturnT runResult = executorBiz.run(triggerParam);
}
diff --git a/xxl-job-core/pom.xml b/xxl-job-core/pom.xml
index f5b88975..f0600552 100644
--- a/xxl-job-core/pom.xml
+++ b/xxl-job-core/pom.xml
@@ -20,6 +20,26 @@
com.xuxueli
xxl-rpc-core
${xxl-rpc.version}
+
+
+ io.netty
+ netty-all
+
+
+ org.apache.commons
+ commons-pool2
+
+
+
+
+ org.eclipse.jetty
+ jetty-server
+ ${jetty-server.version}
+
+
+ org.eclipse.jetty
+ jetty-client
+ ${jetty-server.version}
diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java b/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
index 81677753..027aa7e4 100644
--- a/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
+++ b/xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
@@ -13,6 +13,7 @@ import com.xxl.rpc.registry.ServiceRegistry;
import com.xxl.rpc.remoting.invoker.XxlRpcInvokerFactory;
import com.xxl.rpc.remoting.invoker.call.CallType;
import com.xxl.rpc.remoting.invoker.reference.XxlRpcReferenceBean;
+import com.xxl.rpc.remoting.invoker.route.LoadBalance;
import com.xxl.rpc.remoting.net.NetEnum;
import com.xxl.rpc.remoting.provider.XxlRpcProviderFactory;
import com.xxl.rpc.serialize.Serializer;
@@ -113,8 +114,19 @@ public class XxlJobExecutor {
String addressUrl = address.concat(AdminBiz.MAPPING);
- AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC,
- AdminBiz.class, null, 10000, addressUrl, accessToken, null).getObject();
+ AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
+ NetEnum.JETTY,
+ Serializer.SerializeEnum.HESSIAN.getSerializer(),
+ CallType.SYNC,
+ LoadBalance.ROUND,
+ AdminBiz.class,
+ null,
+ 10000,
+ addressUrl,
+ accessToken,
+ null,
+ null
+ ).getObject();
if (adminBizList == null) {
adminBizList = new ArrayList();
@@ -130,12 +142,9 @@ public class XxlJobExecutor {
// ---------------------- executor-server (rpc provider) ----------------------
- private XxlRpcInvokerFactory xxlRpcInvokerFactory = null;
private XxlRpcProviderFactory xxlRpcProviderFactory = null;
private void initRpcProvider(String ip, int port, String appName, String accessToken) throws Exception {
- // init invoker factory
- xxlRpcInvokerFactory = new XxlRpcInvokerFactory();
// init, provider factory
String address = IpUtil.getIpPort(ip, port);
@@ -150,7 +159,7 @@ public class XxlJobExecutor {
xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl());
// start
- xxlRpcProviderFactory.start();
+ xxlRpcProviderFactory.start();
}
@@ -168,14 +177,18 @@ public class XxlJobExecutor {
}
@Override
- public boolean registry(String key, String value) {
+ public boolean registry(Set keys, String value) {
return false;
}
@Override
- public boolean remove(String key, String value) {
+ public boolean remove(Set keys, String value) {
return false;
}
@Override
+ public Map> discovery(Set keys) {
+ return null;
+ }
+ @Override
public TreeSet discovery(String key) {
return null;
}
@@ -185,7 +198,7 @@ public class XxlJobExecutor {
private void stopRpcProvider() {
// stop invoker factory
try {
- xxlRpcInvokerFactory.stop();
+ XxlRpcInvokerFactory.getInstance().stop();
} catch (Exception e) {
logger.error(e.getMessage(), e);
}