修改withoutNetty的bug

This commit is contained in:
rewerma
2018-06-12 09:00:55 +08:00
parent 9b7d62717e
commit e4cde2f6a1
2 changed files with 2 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ public class CanalController {
embededCanalServer = CanalServerWithEmbedded.instance(); embededCanalServer = CanalServerWithEmbedded.instance();
embededCanalServer.setCanalInstanceGenerator(instanceGenerator);// 设置自定义的instanceGenerator embededCanalServer.setCanalInstanceGenerator(instanceGenerator);// 设置自定义的instanceGenerator
String canalWithoutNetty = getProperty(properties, CanalConstants.CANAL_WITHOUT_NETTY); String canalWithoutNetty = getProperty(properties, CanalConstants.CANAL_WITHOUT_NETTY);
if (canalWithoutNetty == null || "true".equals(canalWithoutNetty)) { if (canalWithoutNetty == null || "false".equals(canalWithoutNetty)) {
canalServer = CanalServerWithNetty.instance(); canalServer = CanalServerWithNetty.instance();
canalServer.setIp(ip); canalServer.setIp(ip);
canalServer.setPort(port); canalServer.setPort(port);

View File

@@ -30,7 +30,7 @@ public class CanalServerStarter {
Properties properties = new Properties(); Properties properties = new Properties();
if (conf.startsWith(CLASSPATH_URL_PREFIX)) { if (conf.startsWith(CLASSPATH_URL_PREFIX)) {
conf = StringUtils.substringAfter(conf, CLASSPATH_URL_PREFIX); conf = StringUtils.substringAfter(conf, CLASSPATH_URL_PREFIX);
properties.load(com.alibaba.otter.canal.deployer.CanalLauncher.class.getClassLoader().getResourceAsStream(conf)); properties.load(CanalLauncher.class.getClassLoader().getResourceAsStream(conf));
} else { } else {
properties.load(new FileInputStream(conf)); properties.load(new FileInputStream(conf));
} }