diff --git a/dolphinscheduler-alert/pom.xml b/dolphinscheduler-alert/pom.xml index ec65f0dc30..0217760199 100644 --- a/dolphinscheduler-alert/pom.xml +++ b/dolphinscheduler-alert/pom.xml @@ -100,22 +100,6 @@ - - - - - - - - - - - - - - - - maven-assembly-plugin diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java index 9ac76d2838..ee38f3d3c9 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java @@ -57,7 +57,7 @@ public class AlertServer { } public void start(){ - logger.info("Alert Server ready start!"); + logger.info("alert server ready start "); while (Stopper.isRunning()){ try { Thread.sleep(Constants.ALERT_SCAN_INTERVEL); diff --git a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java index ab01f094b6..ad5435a11e 100644 --- a/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java +++ b/dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/utils/PropertyUtils.java @@ -66,12 +66,6 @@ public class PropertyUtils { } } -/* - public static PropertyUtils getInstance(){ - return propertyUtils; - } -*/ - /** * get property value * diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java index 527d828e40..3471f6efdd 100644 --- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java +++ b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/EnterpriseWeChatUtilsTest.java @@ -78,19 +78,19 @@ public class EnterpriseWeChatUtilsTest { public void testSendSingleUserWeChat() { try { String token = EnterpriseWeChatUtils.getToken(); - String msg = EnterpriseWeChatUtils.makeUserSendMsg(listUserId.stream().findFirst().get(), agentId, "您的会议室已经预定,稍后会同步到`邮箱` \n" + - ">**事项详情** \n" + - ">事 项:开会
" + - ">组织者:@miglioguan \n" + - ">参与者:@miglioguan、@kunliu、@jamdeezhou、@kanexiong、@kisonwang \n" + + String msg = EnterpriseWeChatUtils.makeUserSendMsg(listUserId.stream().findFirst().get(), agentId, "your meeting room has been booked and will be synced to the 'mailbox' later \n" + + ">**matter details** \n" + + ">matter:meeting
" + + ">organizer:@miglioguan \n" + + ">participant:@miglioguan、@kunliu、@jamdeezhou、@kanexiong、@kisonwang \n" + "> \n" + - ">会议室:广州TIT 1楼 301 \n" + - ">日 期:2018年5月18日 \n" + - ">时 间:上午9:00-11:00 \n" + + ">meeting room:Guangzhou TIT 1st Floor 301 \n" + + ">date:May 18, 2018 \n" + + ">time:9:00-11:00 am \n" + "> \n" + - ">请准时参加会议。 \n" + + ">please attend the meeting on time\n" + "> \n" + - ">如需修改会议信息,请点击:[修改会议信息](https://work.weixin.qq.com)\""); + ">to modify the meeting information, please click: [Modify Meeting Information](https://work.weixin.qq.com)\""); String resp = EnterpriseWeChatUtils.sendEnterpriseWeChat("utf-8", msg, token); diff --git a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java index b806496e63..96f1d9f21e 100644 --- a/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java +++ b/dolphinscheduler-alert/src/test/java/org/apache/dolphinscheduler/alert/utils/MailUtilsTest.java @@ -48,12 +48,12 @@ public class MailUtilsTest { private static final Logger logger = LoggerFactory.getLogger(MailUtilsTest.class); @Test public void testSendMails() { - String[] receivers = new String[]{"825193156@qq.com"}; - String[] receiversCc = new String[]{"825193156@qq.com"}; + String[] receivers = new String[]{"xxx@qq.com"}; + String[] receiversCc = new String[]{"xxx@qq.com"}; String content ="[\"id:69\"," + "\"name:UserBehavior-0--1193959466\"," + - "\"Job name: 启动工作流\"," + + "\"Job name: Start workflow\"," + "\"State: SUCCESS\"," + "\"Recovery:NO\"," + "\"Run time: 1\"," + @@ -63,7 +63,7 @@ public class MailUtilsTest { "\"Notify group :4\"]"; Alert alert = new Alert(); - alert.setTitle("Mysql异常"); + alert.setTitle("Mysql Exception"); alert.setShowType(ShowType.TEXT); alert.setContent(content); alert.setAlertType(AlertType.EMAIL); @@ -89,18 +89,18 @@ public class MailUtilsTest { public String list2String(){ LinkedHashMap map1 = new LinkedHashMap<>(); - map1.put("mysql服务名称","mysql200"); - map1.put("mysql地址","192.168.xx.xx"); - map1.put("端口","3306"); - map1.put("期间内没有使用索引的查询数握","80"); - map1.put("数据库客户端连接数","190"); + map1.put("mysql service name","mysql200"); + map1.put("mysql address","192.168.xx.xx"); + map1.put("port","3306"); + map1.put("no index of number","80"); + map1.put("database client connections","190"); LinkedHashMap map2 = new LinkedHashMap<>(); - map2.put("mysql服务名称","mysql210"); - map2.put("mysql地址","192.168.xx.xx"); - map2.put("端口","3306"); - map2.put("期间内没有使用索引的查询数握","10"); - map2.put("数据库客户端连接数","90"); + map2.put("mysql service name","mysql210"); + map2.put("mysql address","192.168.xx.xx"); + map2.put("port","3306"); + map2.put("no index of number","10"); + map2.put("database client connections","90"); List> maps = new ArrayList<>(); maps.add(0,map1); @@ -135,7 +135,8 @@ public class MailUtilsTest { Alert alert = new Alert(); alert.setTitle("Mysql Exception"); alert.setShowType(ShowType.TEXT); - alert.setContent("[\"告警时间:2018-02-05\", \"服务名:MYSQL_ALTER\", \"告警名:MYSQL_ALTER_DUMP\", \"获取告警异常!,接口报错,异常信息:timed out\", \"请求地址:http://blog.csdn.net/dreamInTheWorld/article/details/78539286\"]"); + alert.setContent("[\"alarm time:2018-02-05\", \"service name:MYSQL_ALTER\", \"alarm name:MYSQL_ALTER_DUMP\", " + + "\"get the alarm exception.!,interface error,exception information:timed out\", \"request address:http://blog.csdn.net/dreamInTheWorld/article/details/78539286\"]"); alert.setAlertType(AlertType.EMAIL); alert.setAlertGroupId(1); alertDao.addAlert(alert);