任务失败告警邮件发送逻辑优化

pull/8/MERGE
xuxueli 6 years ago
parent 878df30bbc
commit 2016fa7cea

@ -1428,7 +1428,8 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 14、新增Class的加载缓存解决频繁加载Class会使jvm的方法区空间不足导致OOM的问题 - 14、新增Class的加载缓存解决频繁加载Class会使jvm的方法区空间不足导致OOM的问题
- 15、调整首页报表默认区间为本周避免日志量太大查询缓慢 - 15、调整首页报表默认区间为本周避免日志量太大查询缓慢
- 16、LRU路由更新不及时问题修复 - 16、LRU路由更新不及时问题修复
- 17、[迭代中]任务线程隔离: - 17、任务失败告警邮件发送逻辑优化
- 18、[迭代中]任务线程隔离:
- 执行器测异步响应,不存在阻塞不需要隔离; - 执行器测异步响应,不存在阻塞不需要隔离;
- 调度中心共用单一调度线程池可能导致调度阻塞需要线程隔离调度线程池拆分为Fast/Slow两个针对调度较慢的执行器地址请求降级使用Slow线程池考虑是否可以任务级隔离线程池 - 调度中心共用单一调度线程池可能导致调度阻塞需要线程隔离调度线程池拆分为Fast/Slow两个针对调度较慢的执行器地址请求降级使用Slow线程池考虑是否可以任务级隔离线程池

@ -150,6 +150,7 @@ public class JobFailMonitorHelper {
// send monitor email // send monitor email
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) { if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
// alarmContent
String alarmContent = "Alarm Job LogId=" + jobLog.getId(); String alarmContent = "Alarm Job LogId=" + jobLog.getId();
if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) { if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
alarmContent += "<br>TriggerMsg=<br>" + jobLog.getTriggerMsg(); alarmContent += "<br>TriggerMsg=<br>" + jobLog.getTriggerMsg();
@ -158,18 +159,18 @@ public class JobFailMonitorHelper {
alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg(); alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg();
} }
// email info
XxlJobGroup group = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().load(Integer.valueOf(info.getJobGroup()));
String personal = I18nUtil.getString("admin_name_full");
String title = I18nUtil.getString("jobconf_monitor");
String content = MessageFormat.format(mailBodyTemplate,
group!=null?group.getTitle():"null",
info.getId(),
info.getJobDesc(),
alarmContent);
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(","))); Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(",")));
for (String email: emailSet) { for (String email: emailSet) {
XxlJobGroup group = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().load(Integer.valueOf(info.getJobGroup()));
String personal = I18nUtil.getString("admin_name_full");
String title = I18nUtil.getString("jobconf_monitor");
String content = MessageFormat.format(mailBodyTemplate,
group!=null?group.getTitle():"null",
info.getId(),
info.getJobDesc(),
alarmContent);
// make mail // make mail
try { try {

@ -13,7 +13,7 @@ import java.util.concurrent.TimeUnit;
/** /**
* Created by xuxueli on 17/3/2. * Created by xuxueli on 17/3/2.
*/ */
public class ExecutorRegistryThread extends Thread { public class ExecutorRegistryThread {
private static Logger logger = LoggerFactory.getLogger(ExecutorRegistryThread.class); private static Logger logger = LoggerFactory.getLogger(ExecutorRegistryThread.class);
private static ExecutorRegistryThread instance = new ExecutorRegistryThread(); private static ExecutorRegistryThread instance = new ExecutorRegistryThread();

@ -17,7 +17,7 @@ import java.util.concurrent.TimeUnit;
* *
* @author xuxueli 2017-12-29 16:23:43 * @author xuxueli 2017-12-29 16:23:43
*/ */
public class JobLogFileCleanThread extends Thread { public class JobLogFileCleanThread {
private static Logger logger = LoggerFactory.getLogger(JobLogFileCleanThread.class); private static Logger logger = LoggerFactory.getLogger(JobLogFileCleanThread.class);
private static JobLogFileCleanThread instance = new JobLogFileCleanThread(); private static JobLogFileCleanThread instance = new JobLogFileCleanThread();

Loading…
Cancel
Save