|
|
|
@ -150,6 +150,7 @@ public class JobFailMonitorHelper {
|
|
|
|
|
// send monitor email
|
|
|
|
|
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
|
|
|
|
|
|
|
|
|
// alarmContent
|
|
|
|
|
String alarmContent = "Alarm Job LogId=" + jobLog.getId();
|
|
|
|
|
if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
|
alarmContent += "<br>TriggerMsg=<br>" + jobLog.getTriggerMsg();
|
|
|
|
@ -158,18 +159,18 @@ public class JobFailMonitorHelper {
|
|
|
|
|
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(",")));
|
|
|
|
|
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
|
|
|
|
|
try {
|
|
|
|
|