Skip to content

Commit

Permalink
upgrade to 2.0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangkewei committed Nov 8, 2018
1 parent e9dc699 commit 54b7849
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apply plugin: 'java'
version '2.0.2.1'
version '2.0.2.2'

repositories {
maven{ url"http://maven.aliyun.com/nexus/content/groups/public"}
Expand All @@ -25,7 +25,7 @@ subprojects {
ext {
group = 'cn.vbill.middleware.porter'
junitVersion = '4.12'
version '2.0.2.1'
version '2.0.2.2'
springVersion = '1.5.9.RELEASE'
swaggerVersion = '2.7.0'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
@AllArgsConstructor
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AlertPlugin {

EMAIL("EMAIL", "邮件"),

MOBILE("MOBILE", "手机号");
MOBILE("MOBILE", "手机号"),
NONE("NONE", "");

@Getter
private final String code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
package cn.vbill.middleware.porter.boot;

import cn.vbill.middleware.porter.common.client.PublicClientContext;
import cn.vbill.middleware.porter.common.util.ProcessUtils;
import cn.vbill.middleware.porter.common.dic.AlertPlugin;
import cn.vbill.middleware.porter.boot.config.SourcesConfig;
import cn.vbill.middleware.porter.core.NodeContext;
import cn.vbill.middleware.porter.task.TaskController;
Expand Down Expand Up @@ -77,11 +77,13 @@ public static void main(String[] args) {
NodeConfig config = context.getBean(NodeConfig.class);

//从本地初始化告警配置
try {
AlertProviderFactory.INSTANCE.initialize(config.getAlert());
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("告警配置初始化失败, 数据同步节点退出!error:" + e.getMessage());
if (null != config.getAlert() && config.getAlert().getStrategy() != AlertPlugin.NONE) {
try {
AlertProviderFactory.INSTANCE.initialize(config.getAlert());
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("告警配置初始化失败, 数据同步节点退出!error:" + e.getMessage());
}
}

//初始化默认工作任务数
Expand Down Expand Up @@ -115,6 +117,7 @@ public static void main(String[] args) {
//注册节点,注册失败退出进程
ClusterProviderProxy.INSTANCE.broadcast(new NodeRegisterCommand(config.getId(), config.getStatistic().isUpload()));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage() + "数据同步节点退出!error:" + e.getMessage());
}

Expand All @@ -127,7 +130,5 @@ public static void main(String[] args) {
//启动节点任务执行容器,并尝试执行本地配置文件任务
controller.start(null != config.getTask() && !config.getTask().isEmpty() ? config.getTask() : null);
LOGGER.info("NodeBootApplication started");
//保持进程持续运行不退出
ProcessUtils.keepRunning();
}
}
16 changes: 8 additions & 8 deletions porter/porter-boot/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ porter.statistic.upload=false

#集群配置
porter.cluster.strategy=ZOOKEEPER
porter.cluster.client.url=127.0.0.1:2181
porter.cluster.client.url=172.16.135.30:2181
porter.cluster.client.sessionTimeout=100000



#告警配置
porter.alert.strategy=EMAIL
porter.alert.client.host=smtphm.qq.com
porter.alert.client.username=test@qq.com
porter.alert.client.password=123456
porter.alert.client.smtpAuth=true
porter.alert.client.smtpStarttlsEnable=true
porter.alert.client.smtpStarttlsRequired=false
porter.alert.strategy=NONE
#porter.alert.client.host=smtp.qq.com
#porter.alert.client.username=100000@qq.com
#porter.alert.client.password=pssword
#porter.alert.client.smtpAuth=true
#porter.alert.client.smtpStarttlsEnable=true
#porter.alert.client.smtpStarttlsRequired=false

#porter.alert.receiver[0].realName=样板告警人
#porter.alert.receiver[0][email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ public void run() {
}
}, 10, 30, TimeUnit.SECONDS);
} else {
throw new Exception(lockPath + ",节点已注册");
String msg = lockPath + ",节点已注册";
LOGGER.error(msg);
throw new Exception(msg);
}
}

Expand Down

0 comments on commit 54b7849

Please sign in to comment.