调度中心API服务改为自研RPC形式,统一底层通讯模型;

v1.8.2
xuxueli 7 years ago
parent ee07e0b794
commit ff8e43af54

@ -1,8 +1,6 @@
package com.xxl.job.admin.controller;
import com.xxl.job.admin.controller.annotation.PermessionLimit;
import com.xxl.job.admin.core.schedule.XxlJobDynamicScheduler;
import com.xxl.job.core.biz.AdminBiz;
import com.xxl.job.core.rpc.codec.RpcRequest;
import com.xxl.job.core.rpc.codec.RpcResponse;
import com.xxl.job.core.rpc.netcom.NetComServerFactory;
@ -25,10 +23,6 @@ import java.io.OutputStream;
public class JobApiController {
private static Logger logger = LoggerFactory.getLogger(JobApiController.class);
static {
NetComServerFactory.putService(AdminBiz.class, XxlJobDynamicScheduler.adminBiz);
}
private RpcResponse doInvoke(HttpServletRequest request) {
try {
// deserialize request

@ -38,13 +38,15 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware, In
}
// init
private NetComServerFactory serverFactory = new NetComServerFactory();
public void init() throws Exception {
// admin registry monitor run
JobRegistryMonitorHelper.getInstance().start();
// admin monitor run
JobFailMonitorHelper.getInstance().start();
// rpc-service, base on spring-mvc
NetComServerFactory.putService(AdminBiz.class, XxlJobDynamicScheduler.adminBiz);
}
// destroy
@ -54,8 +56,6 @@ public final class XxlJobDynamicScheduler implements ApplicationContextAware, In
// admin monitor stop
JobFailMonitorHelper.getInstance().toStop();
serverFactory.destroy();
}
// xxlJobLogDao、xxlJobInfoDao

@ -52,7 +52,7 @@ public class XxlJobExecutor implements ApplicationContextAware, ApplicationListe
private NetComServerFactory serverFactory = new NetComServerFactory();
public void start() throws Exception {
// executor start
NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl());
NetComServerFactory.putService(ExecutorBiz.class, new ExecutorBizImpl()); // rpc-service, base on jetty
serverFactory.start(port, ip, appName);
// trigger callback thread start

@ -21,7 +21,7 @@ public class JettyClient {
// reqURL
String reqURL = request.getServerAddress();
if (reqURL!=null && reqURL.indexOf("http://")==-1) {
if (reqURL!=null && reqURL.toLowerCase().indexOf("http://")==-1) {
reqURL = "http://" + request.getServerAddress() + "/";
}

Loading…
Cancel
Save