You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2020/10/22 02:21:48 UTC

[shardingsphere-elasticjob] branch master updated: Revise usage of error-handler document (#1635)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere-elasticjob.git


The following commit(s) were added to refs/heads/master by this push:
     new ad4a1e4  Revise usage of error-handler document (#1635)
ad4a1e4 is described below

commit ad4a1e46608b5ca4e27bc77080266b78fc58092d
Author: Yanjie Zhou <zh...@aliyun.com>
AuthorDate: Thu Oct 22 10:21:39 2020 +0800

    Revise usage of error-handler document (#1635)
---
 .../elasticjob-lite/usage/job-api/java-api.cn.md   |  33 +++--
 .../elasticjob-lite/usage/job-api/java-api.en.md   |  35 +++---
 .../usage/job-api/spring-boot-starter.cn.md        | 133 +++++++++++++++++++++
 .../usage/job-api/spring-boot-starter.en.md        | 131 ++++++++++++++++++++
 .../error/handler/email/EmailJobErrorHandler.java  |   4 +-
 .../elasticjob/lite/example/JavaMain.java          |   8 +-
 .../resources/META-INF/application-context.xml     |  12 +-
 .../src/main/resources/application.yml             |  17 ++-
 8 files changed, 325 insertions(+), 48 deletions(-)

diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md
index f7a3b63..4e6455f 100644
--- a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md
+++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.cn.md
@@ -216,7 +216,7 @@ public class JobDemo {
     private static JobConfiguration createScheduleJobConfiguration() {
         // 创建定时作业配置, 并且使用邮件通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("EMAIL").build();
-        setEmailConfiguration(jobConfig);
+        setEmailProperties(jobConfig);
         return jobConfig;
 
     }
@@ -224,13 +224,18 @@ public class JobDemo {
     private static JobConfiguration createOneOffJobConfiguration() {
         // 创建一次性作业配置, 并且使用邮件通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("EMAIL").build();
-        setEmailConfiguration(jobConfig);
+        setEmailProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setEmailConfiguration(final JobConfiguration jobConfig) {
+    private static void setEmailProperties(final JobConfiguration jobConfig) {
         // 设置邮件的配置
-        jobConfig.getExtraConfigurations().add(EmailConfiguration.newBuilder("host", 465, "username", "password", "from@xxx.xx", "to1@xxx.xx,to2xxx.xx").build());
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.HOST, "host");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.PORT, "465");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.USERNAME, "username");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.PASSWORD, "password");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.FROM, "from@xxx.xx");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.TO, "to1@xxx.xx,to1@xxx.xx");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
@@ -265,7 +270,7 @@ public class JobDemo {
     private static JobConfiguration createScheduleJobConfiguration() {
         // 创建定时作业配置, 并且使用企业微信通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("WECHAT").build();
-        setWechatConfiguration(jobConfig);
+        setWechatProperties(jobConfig);
         return jobConfig;
 
     }
@@ -273,13 +278,13 @@ public class JobDemo {
     private static JobConfiguration createOneOffJobConfiguration() {
         // 创建一次性作业配置, 并且使用企业微信通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("WECHAT").build();
-        setWechatConfiguration(jobConfig);
+        setWechatProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setWechatConfiguration(final JobConfiguration jobConfig) {
+    private static void setWechatProperties(final JobConfiguration jobConfig) {
         // 设置企业微信的配置
-        jobConfig.getExtraConfigurations().add(WechatConfiguration.newBuilder("you_webhook").build());
+        jobConfig.getProps().setProperty(WechatPropertiesConstants.WEBHOOK, "you_webhook");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
@@ -315,21 +320,23 @@ public class JobDemo {
     private static JobConfiguration createScheduleJobConfiguration() {
         // 创建定时作业配置, 并且使用企业微信通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("DINGTALK").build();
-        setWechatConfiguration(jobConfig);
+        setDingtalkProperties(jobConfig);
         return jobConfig;
 
     }
 
     private static JobConfiguration createOneOffJobConfiguration() {
-        // 创建一次性作业配置, 并且使用企业微信通知策略
+        // 创建一次性作业配置, 并且使用钉钉通知策略
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("DINGTALK").build();
-        setWechatConfiguration(jobConfig);
+        setDingtalkProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setDingtalkConfiguration(final JobConfiguration jobConfig) {
+    private static void setDingtalkProperties(final JobConfiguration jobConfig) {
         // 设置钉钉的配置
-        jobConfig.getExtraConfigurations().add(DingtalkConfiguration.newBuilder("you_webhook").keyword("keyword").secret("secret").build());
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.WEBHOOK, "you_webhook");
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.KEYWORD, "you_keyword");
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.SECRET, "you_secret");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md
index 793c843..ef02e09 100644
--- a/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md
+++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/java-api.en.md
@@ -215,7 +215,7 @@ public class JobDemo {
     private static JobConfiguration createScheduleJobConfiguration() {
         // Create scheduling job configuration, and the use of email notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("EMAIL").build();
-        setEmailConfiguration(jobConfig);
+        setEmailProperties(jobConfig);
         return jobConfig;
 
     }
@@ -223,13 +223,18 @@ public class JobDemo {
     private static JobConfiguration createOneOffJobConfiguration() {
         // Create one-time job configuration, and the use of email notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("EMAIL").build();
-        setEmailConfiguration(jobConfig);
+        setEmailProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setEmailConfiguration(final JobConfiguration jobConfig) {
+    private static void setEmailProperties(final JobConfiguration jobConfig) {
         // Set the mail configuration.
-        jobConfig.getExtraConfigurations().add(EmailConfiguration.newBuilder("host", 465, "username", "password", "from@xxx.xx", "to1@xxx.xx,to2xxx.xx").build());
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.HOST, "host");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.PORT, "465");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.USERNAME, "username");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.PASSWORD, "password");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.FROM, "from@xxx.xx");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.TO, "to1@xxx.xx,to1@xxx.xx");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
@@ -264,7 +269,7 @@ public class JobDemo {
     private static JobConfiguration createScheduleJobConfiguration() {
         // Create scheduling job configuration, and the use of wechat enterprise notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("WECHAT").build();
-        setWechatConfiguration(jobConfig);
+        setWechatProperties(jobConfig);
         return jobConfig;
 
     }
@@ -272,13 +277,13 @@ public class JobDemo {
     private static JobConfiguration createOneOffJobConfiguration() {
         // Create one-time job configuration, and the use of wechat enterprise notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("WECHAT").build();
-        setWechatConfiguration(jobConfig);
+        setWechatProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setWechatConfiguration(final JobConfiguration jobConfig) {
+    private static void setWechatProperties(final JobConfiguration jobConfig) {
         // Set the configuration for the enterprise wechat.
-        jobConfig.getExtraConfigurations().add(WechatConfiguration.newBuilder("you_webhook").build());
+        jobConfig.getProps().setProperty(WechatPropertiesConstants.WEBHOOK, "you_webhook");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
@@ -311,23 +316,25 @@ public class JobDemo {
     }
     
     private static JobConfiguration createScheduleJobConfiguration() {
-        // Create scheduling job configuration, and the use of wechat enterprise notification strategy.
+        // Create scheduling job configuration, and the use of dingtalk  notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myScheduleJob", 3).cron("0/5 * * * * ?").jobErrorHandlerType("DINGTALK").build();
-        setWechatConfiguration(jobConfig);
+        setDingtalkProperties(jobConfig);
         return jobConfig;
 
     }
 
     private static JobConfiguration createOneOffJobConfiguration() {
-        // Create one-time job configuration, and the use of wechat enterprise notification strategy.
+        // Create one-time job configuration, and the use of dingtalk notification strategy.
         JobConfiguration jobConfig = JobConfiguration.newBuilder("myOneOffJob", 3).jobErrorHandlerType("DINGTALK").build();
-        setWechatConfiguration(jobConfig);
+        setDingtalkProperties(jobConfig);
         return jobConfig;
     }
 
-    private static void setDingtalkConfiguration(final JobConfiguration jobConfig) {
+    private static void setDingtalkProperties(final JobConfiguration jobConfig) {
         // Set the configuration of the dingtalk.
-        jobConfig.getExtraConfigurations().add(DingtalkConfiguration.newBuilder("you_webhook").keyword("keyword").secret("secret").build());
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.WEBHOOK, "you_webhook");
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.KEYWORD, "you_keyword");
+        jobConfig.getProps().setProperty(DingtalkPropertiesConstants.SECRET, "you_secret");
     }
 
     private static CoordinatorRegistryCenter createRegistryCenter() {
diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md
index e87e02f..ed8e321 100644
--- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md
+++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.cn.md
@@ -99,3 +99,136 @@ public class OneOffJobController {
 }
 ```
 
+
+## 配置错误处理策略
+
+使用 ElasticJob-Lite 过程中当作业发生异常后,可采用以下错误处理策略。
+
+| *错误处理策略名称*         | *说明*                            |  *是否内置* | *是否默认*| *是否需要额外配置* |
+| ----------------------- | --------------------------------- |  -------  |  --------|  -------------  |
+| 记录日志策略              | 记录作业异常日志,但不中断作业执行     |   是       |     是   |                 |
+| 抛出异常策略              | 抛出系统异常并中断作业执行            |   是       |         |                 |
+| 忽略异常策略              | 忽略系统异常且不中断作业执行          |   是       |          |                 |
+| 邮件通知策略              | 发送邮件消息通知,但不中断作业执行     |            |          |      是         |
+| 企业微信通知策略           | 发送企业微信消息通知,但不中断作业执行 |            |          |      是          |
+| 钉钉通知策略              | 发送钉钉消息通知,但不中断作业执行     |            |          |      是          |
+
+### 记录日志策略
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: LOG 
+```
+
+### 抛出异常策略
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: THROW 
+```
+
+
+### 忽略异常策略
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: IGNORE 
+```
+
+### 邮件通知策略
+
+请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#邮件通知策略) 了解更多。
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-email</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: EMAIL 
+  props:
+    email:
+      host: host
+      port: 465
+      username: username
+      password: password
+      useSsl: true
+      subject: ElasticJob error message
+      from: from@xxx.xx
+      to: to1@xxx.xx,to2@xxx.xx
+      cc: cc@xxx.xx
+      bcc: bcc@xxx.xx
+      debug: false
+```
+
+### 企业微信通知策略
+
+请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#企业微信通知策略) 了解更多。
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-wechat</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: WECHAT 
+  props:
+    wechat:
+      webhook: you_webhook
+      connectTimeout: 3000
+      readTimeout: 5000
+```
+
+
+### 钉钉通知策略
+
+请参考 [这里](/cn/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#钉钉通知策略) 了解更多。
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-dingtalk</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: DINGTALK 
+  props:
+    dingtalk:
+       webhook: you_webhook
+       keyword: you_keyword
+       secret: you_secret
+       connectTimeout: 3000
+       readTimeout: 5000
+```
diff --git a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md
index da60a9d..10c4399 100644
--- a/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md
+++ b/docs/content/user-manual/elasticjob-lite/usage/job-api/spring-boot-starter.en.md
@@ -100,3 +100,134 @@ public class OneOffJobController {
     }
 }
 ```
+
+## Configuration error handler strategy
+
+In the process of using ElasticJob-Lite, when the job is abnormal, the following error handling strategies can be used.
+
+| *Error handler strategy name*            | *Description*                                                 |  *Built-in*  | *Default*| *Extra config*   |
+| ---------------------------------------- | ------------------------------------------------------------- |  -------     |  --------|  --------------  |
+| Log Strategy                             | Log error and do not interrupt job                            |   Yes        |     Yes  |                  |
+| Throw Strategy                           | Throw system exception and interrupt job                      |   Yes        |          |                  |
+| Ignore Strategy                          | Ignore exception and do not interrupt job                     |   Yes        |          |                  |
+| Email Notification Strategy              | Send email message notification and do not interrupt job      |              |          |    Yes           |
+| Wechat Enterprise Notification Strategy  | Send wechat message notification and do not interrupt job     |              |          |    Yes           |
+| Dingtalk Notification Strategy           | Send dingtalk message notification and do not interrupt job   |              |          |    Yes           |
+
+### Log Strategy
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: LOG 
+```
+
+### Throw Strategy
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: THROW 
+```
+
+### Ignore Strategy
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: IGNORE 
+```
+
+### Email Notification Strategy
+
+Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#email-notification-strategy) for more details.
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-email</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: EMAIL 
+  props:
+    email:
+      host: host
+      port: 465
+      username: username
+      password: password
+      useSsl: true
+      subject: ElasticJob error message
+      from: from@xxx.xx
+      to: to1@xxx.xx,to2@xxx.xx
+      cc: cc@xxx.xx
+      bcc: bcc@xxx.xx
+      debug: false
+```
+
+### Wechat Enterprise Notification Strategy
+
+Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#wechat-enterprise-notification-strategy) for more details.
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-wechat</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: WECHAT 
+  props:
+    wechat:
+      webhook: you_webhook
+      connectTimeout: 3000
+      readTimeout: 5000
+```
+
+### Dingtalk Notification Strategy
+
+Please refer to [here](/en/user-manual/elasticjob-lite/configuration/built-in-strategy/error-handler/#dingtalk-notification-strategy) for more details.
+
+Maven POM:
+```xml
+<dependency>
+    <groupId>org.apache.shardingsphere.elasticjob</groupId>
+    <artifactId>elasticjob-error-handler-dingtalk</artifactId>
+    <version>${latest.release.version}</version>
+</dependency>
+```
+```yaml
+elasticjob:
+  regCenter:
+    ...
+  jobs:
+    ...
+    jobErrorHandlerType: DINGTALK 
+  props:
+    dingtalk:
+       webhook: you_webhook
+       keyword: you_keyword
+       secret: you_secret
+       connectTimeout: 3000
+       readTimeout: 5000
+```
diff --git a/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java b/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java
index 280602d..42479bf 100644
--- a/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java
+++ b/elasticjob-error-handler/elasticjob-error-handler-type/elasticjob-error-handler-email/src/main/java/org/apache/shardingsphere/elasticjob/error/handler/email/EmailJobErrorHandler.java
@@ -65,13 +65,13 @@ public final class EmailJobErrorHandler implements JobErrorHandler {
         int port = Integer.parseInt(props.getProperty(EmailPropertiesConstants.PORT));
         String username = props.getProperty(EmailPropertiesConstants.USERNAME);
         String password = props.getProperty(EmailPropertiesConstants.PASSWORD);
-        boolean isUseSSL = Boolean.getBoolean(props.getProperty(EmailPropertiesConstants.IS_USE_SSL, EmailPropertiesConstants.DEFAULT_IS_USE_SSL));
+        boolean isUseSSL = Boolean.parseBoolean(props.getProperty(EmailPropertiesConstants.IS_USE_SSL, EmailPropertiesConstants.DEFAULT_IS_USE_SSL));
         String subject = props.getProperty(EmailPropertiesConstants.SUBJECT, EmailPropertiesConstants.DEFAULT_SUBJECT);
         String from = props.getProperty(EmailPropertiesConstants.FROM);
         String to = props.getProperty(EmailPropertiesConstants.TO);
         String cc = props.getProperty(EmailPropertiesConstants.CC);
         String bcc = props.getProperty(EmailPropertiesConstants.BCC);
-        boolean isDebug = Boolean.getBoolean(props.getProperty(EmailPropertiesConstants.IS_DEBUG, EmailPropertiesConstants.DEFAULT_IS_DEBUG));
+        boolean isDebug = Boolean.parseBoolean(props.getProperty(EmailPropertiesConstants.IS_DEBUG, EmailPropertiesConstants.DEFAULT_IS_DEBUG));
         return new EmailConfiguration(host, port, username, password, isUseSSL, subject, from, to, cc, bcc, isDebug);
     }
     
diff --git a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
index c6d517f..654d657 100644
--- a/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
+++ b/examples/elasticjob-example-lite-java/src/main/java/org/apache/shardingsphere/elasticjob/lite/example/JavaMain.java
@@ -145,12 +145,12 @@ public final class JavaMain {
     }
     
     private static void setEmailProperties(final JobConfiguration jobConfig) {
-        jobConfig.getProps().setProperty(EmailPropertiesConstants.HOST, "localhost");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.HOST, "host");
         jobConfig.getProps().setProperty(EmailPropertiesConstants.PORT, "465");
-        jobConfig.getProps().setProperty(EmailPropertiesConstants.USERNAME, "user");
-        jobConfig.getProps().setProperty(EmailPropertiesConstants.PASSWORD, "xxx");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.USERNAME, "username");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.PASSWORD, "password");
         jobConfig.getProps().setProperty(EmailPropertiesConstants.FROM, "from@xxx.xx");
-        jobConfig.getProps().setProperty(EmailPropertiesConstants.TO, "to1@xxx.xx,to2xxx.xx");
+        jobConfig.getProps().setProperty(EmailPropertiesConstants.TO, "to1@xxx.xx,to1@xxx.xx");
     }
     
     private static void setDingtalkProperties(final JobConfiguration jobConfig) {
diff --git a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml
index aa9e720..6cb067a 100644
--- a/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml
+++ b/examples/elasticjob-example-lite-spring/src/main/resources/META-INF/application-context.xml
@@ -88,17 +88,17 @@
 <!--                    description="${occurErrorNoticeEmailJob.description}"-->
 <!--                    disabled="${occurErrorNoticeEmailJob.disabled}" overwrite="${occurErrorNoticeEmailJob.overwrite}">-->
 <!--        <props>-->
-<!--            <prop key="email.host">localhost</prop>-->
+<!--            <prop key="email.host">host</prop>-->
 <!--            <prop key="email.port">465</prop>-->
-<!--            <prop key="email.username">user</prop>-->
-<!--            <prop key="email.password">xxx</prop>-->
-<!--            <prop key="email.from">from@xxx.com</prop>-->
-<!--            <prop key="email.to">to1@xxx.com,to2@xxx.com</prop>-->
+<!--            <prop key="email.username">username</prop>-->
+<!--            <prop key="email.password">password</prop>-->
+<!--            <prop key="email.from">from@xxx.xx</prop>-->
+<!--            <prop key="email.to">to1@xxx.xx,to2@xxx.xx</prop>-->
 <!--        </props>-->
 <!--    </elasticjob:job>-->
     
     <!-- use dingtalk error handler -->
-    <bean id="occurErrorNoticeDingtalkJob" class="org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaOccurErrorJob" />
+<!--    <bean id="occurErrorNoticeDingtalkJob" class="org.apache.shardingsphere.elasticjob.lite.example.job.simple.JavaOccurErrorJob" />-->
 <!--    <elasticjob:job id="${occurErrorNoticeDingtalkJob.id}" job-ref="occurErrorNoticeDingtalkJob"-->
 <!--                    registry-center-ref="regCenter" tracing-ref="elasticJobTrace"-->
 <!--                    sharding-total-count="${occurErrorNoticeDingtalkJob.shardingTotalCount}"-->
diff --git a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml
index e479242..d487f0a 100644
--- a/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml
+++ b/examples/elasticjob-example-lite-springboot/src/main/resources/application.yml
@@ -40,9 +40,9 @@ elasticjob:
       jobBootstrapBeanName: occurErrorNoticeDingtalkBean
       props:
         dingtalk:
-          webhook: https://oapi.dingtalk.com/robot/send?access_token=42eead064e81ce81fc6af2c107fbe10a4339a3d40a7db8abf5b34d8261527a3f
-          keyword: keyword
-          secret: SEC0b0a6b13b6823b95737dd83491c23adee5d8a7a649899a12217e038eddc84ff4
+          webhook: you_webhook
+          keyword: you_keyword
+          secret: you_secret
           connectTimeout: 3000
           readTimeout: 5000
     occurErrorNoticeWechatJob:
@@ -54,7 +54,7 @@ elasticjob:
       jobBootstrapBeanName: occurErrorNoticeWechatBean
       props:
         wechat:
-          webhook: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=5308e20a-2900-484b-a332-b5bb701ade04
+          webhook: you_webhook
           connectTimeout: 3000
           readTimeout: 5000
     occurErrorNoticeEmailJob:
@@ -70,13 +70,12 @@ elasticjob:
           port: 465
           username: username
           password: password
-          protocol: smtp
           useSsl: true
           subject: ElasticJob error message
-          from: from@xxx.com
-          to: to1@xxx.com,to2@xxx.com
-          cc: cc@xxx.com
-          bcc: bcc@xxx.com
+          from: from@xxx.xx
+          to: to1@xxx.xx,to2@xxx.xx
+          cc: cc@xxx.xx
+          bcc: bcc@xxx.xx
           debug: false
   dump:
     port: 9888