From 85bf6569350f0bac3ed8c256ac6218661f5f575a Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Fri, 15 Feb 2019 22:17:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=95=E5=B1=82=E9=80=9A=E8=AE=AF=E6=96=B9?= =?UTF-8?q?=E6=A1=88=E4=BC=98=E5=8C=96=EF=BC=9A=E5=8D=87=E7=BA=A7=E8=BE=83?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=ACxxl-rpc=EF=BC=8C=E7=94=B1"JETTY"?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E8=B0=83=E6=95=B4=E4=B8=BA"NETTY=5FHTTP"?= =?UTF-8?q?=E6=96=B9=E6=A1=88=EF=BC=8C=E6=89=A7=E8=A1=8C=E5=99=A8=E5=86=85?= =?UTF-8?q?=E5=B5=8Cnetty-http-server=E6=8F=90=E4=BE=9B=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E5=BA=A6=E4=B8=AD=E5=BF=83=E5=A4=8D=E7=94=A8?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E7=AB=AF=E5=8F=A3=E6=8F=90=E4=BE=9B=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 5 ++-- pom.xml | 3 +- xxl-job-admin/pom.xml | 28 ------------------- .../core/schedule/XxlJobDynamicScheduler.java | 13 ++++----- .../com/xxl/job/adminbiz/AdminBizTest.java | 4 +-- .../com/xxl/job/executor/ExecutorBizTest.java | 2 +- xxl-job-core/pom.xml | 20 ------------- .../xxl/job/core/executor/XxlJobExecutor.java | 4 +-- .../pom.xml | 28 ------------------- 9 files changed, 14 insertions(+), 93 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 614b10d0..56b38abd 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1419,6 +1419,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 5、精简项目,取消第三方依赖,如 commons-collections4 ; - 6、底层Log调优,应用正常终止取消异常栈信息打印; - 7、交互优化,尽量避免新开页面窗口;仅WebIDE支持新开页,并提供窗口快速关闭按钮; +- 8、[测试中]底层通讯方案优化:升级较新版本xxl-rpc,由"JETTY"方案调整为"NETTY_HTTP"方案,执行器内嵌netty-http-server提供服务,调度中心复用容器端口提供服务; - [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁; - [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容; - [迭代中]提供执行器Docker镜像; @@ -1457,9 +1458,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 31、调度中心-执行器通讯模型统一,双向RPC切换为Netty; - 32、任务暂停、删除优化,避免quartz delete不完整导致任务脏数据; - 32、quartz misfire 配置优化,计划改为0; -- 33、job通讯调优: - - 调度tcp; - - 回调http(netty),handler复用mvc(考虑是否双向tcp); + ## 七、其他 diff --git a/pom.xml b/pom.xml index ab3aff5e..d6e0525c 100644 --- a/pom.xml +++ b/pom.xml @@ -24,8 +24,7 @@ 1.7 true - 1.3.1 - 9.2.26.v20180806 + 1.3.2-SNAPSHOT 1.5.18.RELEASE 1.3.2 diff --git a/xxl-job-admin/pom.xml b/xxl-job-admin/pom.xml index f1f065b5..fe64c1d3 100644 --- a/xxl-job-admin/pom.xml +++ b/xxl-job-admin/pom.xml @@ -18,34 +18,6 @@ pom import - - - - org.eclipse.jetty - jetty-server - ${jetty-server.version} - - - org.eclipse.jetty - jetty-util - ${jetty-server.version} - - - org.eclipse.jetty - jetty-http - ${jetty-server.version} - - - org.eclipse.jetty - jetty-io - ${jetty-server.version} - - - org.eclipse.jetty - jetty-client - ${jetty-server.version} - - 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 e9fba260..5dd891a8 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 @@ -15,10 +15,9 @@ 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.net.impl.servlet.server.ServletServerHandler; import com.xxl.rpc.remoting.provider.XxlRpcProviderFactory; import com.xxl.rpc.serialize.Serializer; -import org.eclipse.jetty.server.Request; import org.quartz.*; import org.quartz.Trigger.TriggerState; import org.quartz.impl.triggers.CronTriggerImpl; @@ -95,12 +94,12 @@ public final class XxlJobDynamicScheduler { // ---------------------- admin rpc provider (no server version) ---------------------- - private static JettyServerHandler jettyServerHandler; + private static ServletServerHandler servletServerHandler; private void initRpcProvider(){ // init XxlRpcProviderFactory xxlRpcProviderFactory = new XxlRpcProviderFactory(); xxlRpcProviderFactory.initConfig( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), null, 0, @@ -112,13 +111,13 @@ public final class XxlJobDynamicScheduler { xxlRpcProviderFactory.addService(AdminBiz.class.getName(), null, XxlJobAdminConfig.getAdminConfig().getAdminBiz()); // jetty handler - jettyServerHandler = new JettyServerHandler(xxlRpcProviderFactory); + servletServerHandler = new ServletServerHandler(xxlRpcProviderFactory); } private void stopRpcProvider() throws Exception { XxlRpcInvokerFactory.getInstance().stop(); } public static void invokeAdminService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { - jettyServerHandler.handle(null, new Request(null, null), request, response); + servletServerHandler.handle(null, request, response); } @@ -139,7 +138,7 @@ public final class XxlJobDynamicScheduler { // set-cache executorBiz = (ExecutorBiz) new XxlRpcReferenceBean( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC, LoadBalance.ROUND, 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 249113b8..d588cb6b 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 @@ -33,7 +33,7 @@ public class AdminBizTest { public void registryTest() throws Exception { addressUrl = addressUrl.replace("http://", ""); AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC, LoadBalance.ROUND, @@ -63,7 +63,7 @@ public class AdminBizTest { public void registryRemove() throws Exception { addressUrl = addressUrl.replace("http://", ""); AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC, LoadBalance.ROUND, 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 3892c1f9..53080dda 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 @@ -50,7 +50,7 @@ public class ExecutorBizTest { // do remote trigger String accessToken = null; ExecutorBiz executorBiz = (ExecutorBiz) new XxlRpcReferenceBean( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC, LoadBalance.ROUND, diff --git a/xxl-job-core/pom.xml b/xxl-job-core/pom.xml index f0600552..f5b88975 100644 --- a/xxl-job-core/pom.xml +++ b/xxl-job-core/pom.xml @@ -20,26 +20,6 @@ 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 027aa7e4..b38eff72 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 @@ -115,7 +115,7 @@ public class XxlJobExecutor { String addressUrl = address.concat(AdminBiz.MAPPING); AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( - NetEnum.JETTY, + NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), CallType.SYNC, LoadBalance.ROUND, @@ -153,7 +153,7 @@ public class XxlJobExecutor { serviceRegistryParam.put("address", address); xxlRpcProviderFactory = new XxlRpcProviderFactory(); - xxlRpcProviderFactory.initConfig(NetEnum.JETTY, Serializer.SerializeEnum.HESSIAN.getSerializer(), ip, port, accessToken, ExecutorServiceRegistry.class, serviceRegistryParam); + xxlRpcProviderFactory.initConfig(NetEnum.NETTY_HTTP, Serializer.SerializeEnum.HESSIAN.getSerializer(), ip, port, accessToken, ExecutorServiceRegistry.class, serviceRegistryParam); // add services xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl()); diff --git a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml index 1e196553..25a1c2b2 100644 --- a/xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml +++ b/xxl-job-executor-samples/xxl-job-executor-sample-springboot/pom.xml @@ -28,34 +28,6 @@ pom import - - - - org.eclipse.jetty - jetty-server - ${jetty-server.version} - - - org.eclipse.jetty - jetty-util - ${jetty-server.version} - - - org.eclipse.jetty - jetty-http - ${jetty-server.version} - - - org.eclipse.jetty - jetty-io - ${jetty-server.version} - - - org.eclipse.jetty - jetty-client - ${jetty-server.version} - -