提交 85bf6569 编写于 作者: 许雪里's avatar 许雪里

底层通讯方案优化:升级较新版本xxl-rpc,由"JETTY"方案调整为"NETTY_HTTP"方案,执行器内嵌netty-http-server提供服务,调度中心复用容器端口提供服务;

上级 573facc0
...@@ -1419,6 +1419,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 ...@@ -1419,6 +1419,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 5、精简项目,取消第三方依赖,如 commons-collections4 ; - 5、精简项目,取消第三方依赖,如 commons-collections4 ;
- 6、底层Log调优,应用正常终止取消异常栈信息打印; - 6、底层Log调优,应用正常终止取消异常栈信息打印;
- 7、交互优化,尽量避免新开页面窗口;仅WebIDE支持新开页,并提供窗口快速关闭按钮; - 7、交互优化,尽量避免新开页面窗口;仅WebIDE支持新开页,并提供窗口快速关闭按钮;
- 8、[测试中]底层通讯方案优化:升级较新版本xxl-rpc,由"JETTY"方案调整为"NETTY_HTTP"方案,执行器内嵌netty-http-server提供服务,调度中心复用容器端口提供服务;
- [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁; - [迭代中]注册中心优化,实时性注册发现:心跳注册间隔10s,refresh失败则首次注册并立即更新注册信息,心跳类似;30s过期销毁;
- [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容; - [迭代中]脚本任务,支持数据参数,新版本仅支持单参数不支持需要兼容;
- [迭代中]提供执行器Docker镜像; - [迭代中]提供执行器Docker镜像;
...@@ -1457,9 +1458,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 ...@@ -1457,9 +1458,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 31、调度中心-执行器通讯模型统一,双向RPC切换为Netty; - 31、调度中心-执行器通讯模型统一,双向RPC切换为Netty;
- 32、任务暂停、删除优化,避免quartz delete不完整导致任务脏数据; - 32、任务暂停、删除优化,避免quartz delete不完整导致任务脏数据;
- 32、quartz misfire 配置优化,计划改为0; - 32、quartz misfire 配置优化,计划改为0;
- 33、job通讯调优:
- 调度tcp;
- 回调http(netty),handler复用mvc(考虑是否双向tcp);
## 七、其他 ## 七、其他
......
...@@ -24,8 +24,7 @@ ...@@ -24,8 +24,7 @@
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<maven.test.skip>true</maven.test.skip> <maven.test.skip>true</maven.test.skip>
<xxl-rpc.version>1.3.1</xxl-rpc.version> <xxl-rpc.version>1.3.2-SNAPSHOT</xxl-rpc.version>
<jetty-server.version>9.2.26.v20180806</jetty-server.version>
<spring-boot.version>1.5.18.RELEASE</spring-boot.version> <spring-boot.version>1.5.18.RELEASE</spring-boot.version>
<mybatis-spring-boot-starter.version>1.3.2</mybatis-spring-boot-starter.version> <mybatis-spring-boot-starter.version>1.3.2</mybatis-spring-boot-starter.version>
......
...@@ -18,34 +18,6 @@ ...@@ -18,34 +18,6 @@
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<!-- jetty -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${jetty-server.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
...@@ -15,10 +15,9 @@ import com.xxl.rpc.remoting.invoker.call.CallType; ...@@ -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.reference.XxlRpcReferenceBean;
import com.xxl.rpc.remoting.invoker.route.LoadBalance; import com.xxl.rpc.remoting.invoker.route.LoadBalance;
import com.xxl.rpc.remoting.net.NetEnum; 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.remoting.provider.XxlRpcProviderFactory;
import com.xxl.rpc.serialize.Serializer; import com.xxl.rpc.serialize.Serializer;
import org.eclipse.jetty.server.Request;
import org.quartz.*; import org.quartz.*;
import org.quartz.Trigger.TriggerState; import org.quartz.Trigger.TriggerState;
import org.quartz.impl.triggers.CronTriggerImpl; import org.quartz.impl.triggers.CronTriggerImpl;
...@@ -95,12 +94,12 @@ public final class XxlJobDynamicScheduler { ...@@ -95,12 +94,12 @@ public final class XxlJobDynamicScheduler {
// ---------------------- admin rpc provider (no server version) ---------------------- // ---------------------- admin rpc provider (no server version) ----------------------
private static JettyServerHandler jettyServerHandler; private static ServletServerHandler servletServerHandler;
private void initRpcProvider(){ private void initRpcProvider(){
// init // init
XxlRpcProviderFactory xxlRpcProviderFactory = new XxlRpcProviderFactory(); XxlRpcProviderFactory xxlRpcProviderFactory = new XxlRpcProviderFactory();
xxlRpcProviderFactory.initConfig( xxlRpcProviderFactory.initConfig(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
null, null,
0, 0,
...@@ -112,13 +111,13 @@ public final class XxlJobDynamicScheduler { ...@@ -112,13 +111,13 @@ public final class XxlJobDynamicScheduler {
xxlRpcProviderFactory.addService(AdminBiz.class.getName(), null, XxlJobAdminConfig.getAdminConfig().getAdminBiz()); xxlRpcProviderFactory.addService(AdminBiz.class.getName(), null, XxlJobAdminConfig.getAdminConfig().getAdminBiz());
// jetty handler // jetty handler
jettyServerHandler = new JettyServerHandler(xxlRpcProviderFactory); servletServerHandler = new ServletServerHandler(xxlRpcProviderFactory);
} }
private void stopRpcProvider() throws Exception { private void stopRpcProvider() throws Exception {
XxlRpcInvokerFactory.getInstance().stop(); XxlRpcInvokerFactory.getInstance().stop();
} }
public static void invokeAdminService(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { 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 { ...@@ -139,7 +138,7 @@ public final class XxlJobDynamicScheduler {
// set-cache // set-cache
executorBiz = (ExecutorBiz) new XxlRpcReferenceBean( executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
CallType.SYNC, CallType.SYNC,
LoadBalance.ROUND, LoadBalance.ROUND,
......
...@@ -33,7 +33,7 @@ public class AdminBizTest { ...@@ -33,7 +33,7 @@ public class AdminBizTest {
public void registryTest() throws Exception { public void registryTest() throws Exception {
addressUrl = addressUrl.replace("http://", ""); addressUrl = addressUrl.replace("http://", "");
AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
CallType.SYNC, CallType.SYNC,
LoadBalance.ROUND, LoadBalance.ROUND,
...@@ -63,7 +63,7 @@ public class AdminBizTest { ...@@ -63,7 +63,7 @@ public class AdminBizTest {
public void registryRemove() throws Exception { public void registryRemove() throws Exception {
addressUrl = addressUrl.replace("http://", ""); addressUrl = addressUrl.replace("http://", "");
AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
CallType.SYNC, CallType.SYNC,
LoadBalance.ROUND, LoadBalance.ROUND,
......
...@@ -50,7 +50,7 @@ public class ExecutorBizTest { ...@@ -50,7 +50,7 @@ public class ExecutorBizTest {
// do remote trigger // do remote trigger
String accessToken = null; String accessToken = null;
ExecutorBiz executorBiz = (ExecutorBiz) new XxlRpcReferenceBean( ExecutorBiz executorBiz = (ExecutorBiz) new XxlRpcReferenceBean(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
CallType.SYNC, CallType.SYNC,
LoadBalance.ROUND, LoadBalance.ROUND,
......
...@@ -20,26 +20,6 @@ ...@@ -20,26 +20,6 @@
<groupId>com.xuxueli</groupId> <groupId>com.xuxueli</groupId>
<artifactId>xxl-rpc-core</artifactId> <artifactId>xxl-rpc-core</artifactId>
<version>${xxl-rpc.version}</version> <version>${xxl-rpc.version}</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${jetty-server.version}</version>
</dependency> </dependency>
<!-- groovy-all --> <!-- groovy-all -->
......
...@@ -115,7 +115,7 @@ public class XxlJobExecutor { ...@@ -115,7 +115,7 @@ public class XxlJobExecutor {
String addressUrl = address.concat(AdminBiz.MAPPING); String addressUrl = address.concat(AdminBiz.MAPPING);
AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean( AdminBiz adminBiz = (AdminBiz) new XxlRpcReferenceBean(
NetEnum.JETTY, NetEnum.NETTY_HTTP,
Serializer.SerializeEnum.HESSIAN.getSerializer(), Serializer.SerializeEnum.HESSIAN.getSerializer(),
CallType.SYNC, CallType.SYNC,
LoadBalance.ROUND, LoadBalance.ROUND,
...@@ -153,7 +153,7 @@ public class XxlJobExecutor { ...@@ -153,7 +153,7 @@ public class XxlJobExecutor {
serviceRegistryParam.put("address", address); serviceRegistryParam.put("address", address);
xxlRpcProviderFactory = new XxlRpcProviderFactory(); 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 // add services
xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl()); xxlRpcProviderFactory.addService(ExecutorBiz.class.getName(), null, new ExecutorBizImpl());
......
...@@ -28,34 +28,6 @@ ...@@ -28,34 +28,6 @@
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
<!-- jetty -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>${jetty-server.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-client</artifactId>
<version>${jetty-server.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册