Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
caf38881
提交
caf38881
authored
6月 24, 2018
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
告警邮件中展示失败告警信息;
上级
239d3e68
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
32 行增加
和
66 行删除
+32
-66
XXL-JOB官方文档.md
doc/XXL-JOB官方文档.md
+10
-10
JobFailMonitorHelper.java
...a/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
+19
-5
message.properties
xxl-job-admin/src/main/resources/i18n/message.properties
+1
-0
message_en.properties
xxl-job-admin/src/main/resources/i18n/message_en.properties
+1
-0
MailUtilTest.java
...in/src/test/java/com/xxl/job/admin/util/MailUtilTest.java
+0
-50
JobThread.java
...core/src/main/java/com/xxl/job/core/thread/JobThread.java
+1
-1
没有找到文件。
doc/XXL-JOB官方文档.md
浏览文件 @
caf38881
...
@@ -1215,7 +1215,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
...
@@ -1215,7 +1215,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
### 6.22 版本 V1.9.2 特性[迭代中]
### 6.22 版本 V1.9.2 特性[迭代中]
-
1、
[
迭代中
]
支持通过API服务操作任务信息;
-
1、
[
迭代中
]
支持通过API服务操作任务信息;
-
2、
[
迭代中
]
任务告警逻辑调整:任务调度,以及任务回调失败时,均推送监控队列。后期考虑通过任务Log字段控制告警状态
;
-
2、
告警邮件中展示失败告警信息
;
-
3、任务超时控制:支持设置任务超时时间,任务运行超时的情况下,将会主动中断任务;
-
3、任务超时控制:支持设置任务超时时间,任务运行超时的情况下,将会主动中断任务;
-
4、任务属性枚举 "任务模式、阻塞策略" 国际化优化;
-
4、任务属性枚举 "任务模式、阻塞策略" 国际化优化;
-
5、任务日志表状态字段类型优化;
-
5、任务日志表状态字段类型优化;
...
@@ -1248,16 +1248,16 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
...
@@ -1248,16 +1248,16 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
13、任务依赖增强,新增任务类型 "流程任务",流程节点可挂载普通类型任务,承担任务依赖功能。现有子任务模型取消;需要考虑任务依赖死循环问题;
-
13、任务依赖增强,新增任务类型 "流程任务",流程节点可挂载普通类型任务,承担任务依赖功能。现有子任务模型取消;需要考虑任务依赖死循环问题;
-
14、分片任务某一分片失败,支持分片转移;
-
14、分片任务某一分片失败,支持分片转移;
-
15、调度中心触发任务后,先推送触发队列,异步触发,然后立即返回。降低quartz线程占用时长。
-
15、调度中心触发任务后,先推送触发队列,异步触发,然后立即返回。降低quartz线程占用时长。
-
16、
新增API服务 "XxlJobService" ,支持通过API服务来维护管理任务信息
;
-
16、
任务告警逻辑调整:任务调度,以及任务回调失败时,均推送监控队列。后期考虑通过任务Log字段控制告警状态
;
-
17、新增任务默认运行状态,任务更新时运行状态保持不变;
-
17、新增任务默认运行状态,任务更新时运行状态保持不变;
-
18、
告警邮件中展示失败告警信息
;
-
18、
提供多版本执行器:不依赖容器版本、不内嵌Jetty版本(通过配置executoraddress替换jetty通讯)等
;
-
19、
提供多版本执行器:不依赖容器版本、不内嵌Jetty版本(通过配置executoraddress替换jetty通讯)
等;
-
19、
注册中心支持扩展,除默认基于DB之外,支持扩展接入第三方注册中心如zk、eureka
等;
-
20、
注册中心支持扩展,除默认基于DB之外,支持扩展接入第三方注册中心如zk、eureka等
;
-
20、
依赖Core内部国际化处理
;
-
21、
依赖Core内部国际化处理
;
-
21、
故障转移、失败重试等策略,规范化合并归类
;
-
22、
故障转移、失败重试等策略,规范化合并归类
;
-
22、
流程任务,支持参数传递
;
-
23、
流程任务,支持参数传递
;
-
23、
SimpleTrigger 支持
;
-
24、
SimpleTrigger
支持;
-
24、
springboot热部署
支持;
-
25、springboot热部署支持;
## 七、其他
## 七、其他
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
浏览文件 @
caf38881
...
@@ -125,10 +125,11 @@ public class JobFailMonitorHelper {
...
@@ -125,10 +125,11 @@ public class JobFailMonitorHelper {
"<table border=\"1\" cellpadding=\"3\" style=\"border-collapse:collapse; width:80%;\" >\n"
+
"<table border=\"1\" cellpadding=\"3\" style=\"border-collapse:collapse; width:80%;\" >\n"
+
" <thead style=\"font-weight: bold;color: #ffffff;background-color: #ff8c00;\" >"
+
" <thead style=\"font-weight: bold;color: #ffffff;background-color: #ff8c00;\" >"
+
" <tr>\n"
+
" <tr>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobinfo_field_jobgroup"
)
+
"</td>\n"
+
" <td width=\"20%\" >"
+
I18nUtil
.
getString
(
"jobinfo_field_jobgroup"
)
+
"</td>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobinfo_field_id"
)
+
"</td>\n"
+
" <td width=\"10%\" >"
+
I18nUtil
.
getString
(
"jobinfo_field_id"
)
+
"</td>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobinfo_field_jobdesc"
)
+
"</td>\n"
+
" <td width=\"20%\" >"
+
I18nUtil
.
getString
(
"jobinfo_field_jobdesc"
)
+
"</td>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobconf_monitor_alarm_title"
)
+
"</td>\n"
+
" <td width=\"10%\" >"
+
I18nUtil
.
getString
(
"jobconf_monitor_alarm_title"
)
+
"</td>\n"
+
" <td width=\"40%\" >"
+
I18nUtil
.
getString
(
"jobconf_monitor_alarm_content"
)
+
"</td>\n"
+
" </tr>\n"
+
" </tr>\n"
+
" <thead/>\n"
+
" <thead/>\n"
+
" <tbody>\n"
+
" <tbody>\n"
+
...
@@ -137,6 +138,7 @@ public class JobFailMonitorHelper {
...
@@ -137,6 +138,7 @@ public class JobFailMonitorHelper {
" <td>{1}</td>\n"
+
" <td>{1}</td>\n"
+
" <td>{2}</td>\n"
+
" <td>{2}</td>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobconf_monitor_alarm_type"
)
+
"</td>\n"
+
" <td>"
+
I18nUtil
.
getString
(
"jobconf_monitor_alarm_type"
)
+
"</td>\n"
+
" <td>{3}</td>\n"
+
" </tr>\n"
+
" </tr>\n"
+
" <tbody>\n"
+
" <tbody>\n"
+
"</table>"
;
"</table>"
;
...
@@ -152,12 +154,24 @@ public class JobFailMonitorHelper {
...
@@ -152,12 +154,24 @@ public class JobFailMonitorHelper {
XxlJobInfo
info
=
XxlJobDynamicScheduler
.
xxlJobInfoDao
.
loadById
(
jobLog
.
getJobId
());
XxlJobInfo
info
=
XxlJobDynamicScheduler
.
xxlJobInfoDao
.
loadById
(
jobLog
.
getJobId
());
if
(
info
!=
null
&&
info
.
getAlarmEmail
()!=
null
&&
info
.
getAlarmEmail
().
trim
().
length
()>
0
)
{
if
(
info
!=
null
&&
info
.
getAlarmEmail
()!=
null
&&
info
.
getAlarmEmail
().
trim
().
length
()>
0
)
{
String
alarmContent
=
"Alarm Job LogId="
+
jobLog
.
getId
();
if
(
jobLog
.
getTriggerCode
()
!=
ReturnT
.
SUCCESS_CODE
)
{
alarmContent
+=
"<br>TriggerMsg="
+
jobLog
.
getTriggerMsg
();
}
if
(
jobLog
.
getHandleCode
()>
0
&&
jobLog
.
getHandleCode
()
!=
ReturnT
.
SUCCESS_CODE
)
{
alarmContent
+=
"<br>HandleCode="
+
jobLog
.
getHandleMsg
();
}
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
=
XxlJobDynamicScheduler
.
xxlJobGroupDao
.
load
(
Integer
.
valueOf
(
info
.
getJobGroup
()));
XxlJobGroup
group
=
XxlJobDynamicScheduler
.
xxlJobGroupDao
.
load
(
Integer
.
valueOf
(
info
.
getJobGroup
()));
String
title
=
I18nUtil
.
getString
(
"jobconf_monitor"
);
String
title
=
I18nUtil
.
getString
(
"jobconf_monitor"
);
String
content
=
MessageFormat
.
format
(
mailBodyTemplate
,
group
!=
null
?
group
.
getTitle
():
"null"
,
info
.
getId
(),
info
.
getJobDesc
());
String
content
=
MessageFormat
.
format
(
mailBodyTemplate
,
group
!=
null
?
group
.
getTitle
():
"null"
,
info
.
getId
(),
info
.
getJobDesc
(),
alarmContent
);
MailUtil
.
sendMail
(
email
,
title
,
content
);
MailUtil
.
sendMail
(
email
,
title
,
content
);
}
}
...
...
xxl-job-admin/src/main/resources/i18n/message.properties
浏览文件 @
caf38881
...
@@ -215,6 +215,7 @@ jobconf_monitor=调度中心监控报警
...
@@ -215,6 +215,7 @@ jobconf_monitor=调度中心监控报警
jobconf_monitor_detail
=
监控告警明细
jobconf_monitor_detail
=
监控告警明细
jobconf_monitor_alarm_title
=
告警类型
jobconf_monitor_alarm_title
=
告警类型
jobconf_monitor_alarm_type
=
调度失败
jobconf_monitor_alarm_type
=
调度失败
jobconf_monitor_alarm_content
=
告警内容
jobconf_trigger_admin_adress
=
调度机器
jobconf_trigger_admin_adress
=
调度机器
jobconf_trigger_exe_regtype
=
执行器-注册方式
jobconf_trigger_exe_regtype
=
执行器-注册方式
jobconf_trigger_exe_regaddress
=
执行器-地址列表
jobconf_trigger_exe_regaddress
=
执行器-地址列表
...
...
xxl-job-admin/src/main/resources/i18n/message_en.properties
浏览文件 @
caf38881
...
@@ -215,6 +215,7 @@ jobconf_monitor=Scheduling Center monitor alarm
...
@@ -215,6 +215,7 @@ jobconf_monitor=Scheduling Center monitor alarm
jobconf_monitor_detail
=
monitor alarm details
jobconf_monitor_detail
=
monitor alarm details
jobconf_monitor_alarm_title
=
Alarm Type
jobconf_monitor_alarm_title
=
Alarm Type
jobconf_monitor_alarm_type
=
Trigger Fail
jobconf_monitor_alarm_type
=
Trigger Fail
jobconf_monitor_alarm_content
=
Alarm Content
jobconf_trigger_admin_adress
=
Trigger machine address
jobconf_trigger_admin_adress
=
Trigger machine address
jobconf_trigger_exe_regtype
=
Execotor-Registry Type
jobconf_trigger_exe_regtype
=
Execotor-Registry Type
jobconf_trigger_exe_regaddress
=
Execotor-Registry Address
jobconf_trigger_exe_regaddress
=
Execotor-Registry Address
...
...
xxl-job-admin/src/test/java/com/xxl/job/admin/util/MailUtilTest.java
deleted
100644 → 0
浏览文件 @
239d3e68
package
com
.
xxl
.
job
.
admin
.
util
;
import
com.xxl.job.admin.core.util.MailUtil
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
java.text.MessageFormat
;
/**
* email util test
*
* @author xuxueli 2017-12-22 17:16:23
*/
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
locations
=
"classpath*:spring/applicationcontext-*.xml"
)
public
class
MailUtilTest
{
@Test
public
void
mailTest
()
throws
Exception
{
String
mailBodyTemplate
=
"<h5>监控告警明细:</span>"
+
"<table border=\"1\" cellpadding=\"3\" style=\"border-collapse:collapse; width:80%;\" >\n"
+
" <thead style=\"font-weight: bold;color: #ffffff;background-color: #ff8c00;\" >"
+
" <tr>\n"
+
" <td>执行器</td>\n"
+
" <td>任务ID</td>\n"
+
" <td>任务描述</td>\n"
+
" <td>告警类型</td>\n"
+
" </tr>\n"
+
" <thead/>\n"
+
" <tbody>\n"
+
" <tr>\n"
+
" <td>{0}</td>\n"
+
" <td>{1}</td>\n"
+
" <td>{2}</td>\n"
+
" <td>调度失败</td>\n"
+
" </tr>\n"
+
" <tbody>\n"
+
"</table>"
;
String
title
=
"调度中心监控报警"
;
String
content
=
MessageFormat
.
format
(
mailBodyTemplate
,
"执行器A"
,
"01"
,
"任务A1"
);
boolean
ret
=
MailUtil
.
sendMail
(
"931591021@qq.com"
,
title
,
content
);
System
.
out
.
println
(
ret
);
}
}
xxl-job-core/src/main/java/com/xxl/job/core/thread/JobThread.java
浏览文件 @
caf38881
...
@@ -143,7 +143,7 @@ public class JobThread extends Thread{
...
@@ -143,7 +143,7 @@ public class JobThread extends Thread{
XxlJobLogger
.
log
(
"<br>----------- xxl-job job execute timeout"
);
XxlJobLogger
.
log
(
"<br>----------- xxl-job job execute timeout"
);
XxlJobLogger
.
log
(
e
);
XxlJobLogger
.
log
(
e
);
executeResult
=
new
ReturnT
<
String
>(
IJobHandler
.
FAIL_TIMEOUT
.
getCode
(),
"job execute timeout "
+
e
.
getMessage
()
);
executeResult
=
new
ReturnT
<
String
>(
IJobHandler
.
FAIL_TIMEOUT
.
getCode
(),
"job execute timeout "
);
}
finally
{
}
finally
{
futureThread
.
interrupt
();
futureThread
.
interrupt
();
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论