{"id":10006298,"date":"2022-08-24T11:48:34","date_gmt":"2022-08-24T03:48:34","guid":{"rendered":"https:\/\/ityet.com\/?p=10006298"},"modified":"2022-08-24T11:48:34","modified_gmt":"2022-08-24T03:48:34","slug":"%e5%ae%9a%e6%97%b6%e4%bb%bb%e5%8a%a1%e6%8a%a5%e8%ad%a6%e9%80%9a%e7%9f%a5%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10006298","title":{"rendered":"\u5b9a\u65f6\u4efb\u52a1\u62a5\u8b66\u901a\u77e5\u89e3\u51b3\u65b9\u6848\u8be6\u89e3"},"content":{"rendered":"<p>\u7b80\u4ecb\uff1a\u00a0\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4ee5\u53ca\u5e02\u9762\u4e0a\u5e38\u89c1\u7684\u5f00\u6e90\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u65b9\u6848\u5bf9\u6bd4\u3002\u4ec0\u4e48\u662f\u5b9a\u65f6\u4efb\u52a1\u5b9a\u65f6\u4efb\u52a1\u662f\u6bcf\u4e2a\u4e1a\u52a1\u5e38\u89c1\u7684\u9700\u6c42\uff0c\u6bd4\u5982\u6bcf\u5206\u949f\u626b\u63cf\u8d85\u65f6\u652f\u4ed8\u7684\u8ba2\u5355\uff0c\u6bcf\u5c0f\u65f6\u6e05\u7406\u4e00\u6b21\u6570\u636e\u5e93\u5386\u53f2\u6570\u636e\uff0c\u6bcf\u5929\u7edf\u8ba1\u524d\u4e00\u5929\u7684\u6570\u636e\u5e76\u751f\u6210\u62a5\u8868\u7b49\u7b49\u3002\u968f\u7740\u5fae\u670d\u52a1\u548c\u4e91\u8ba1\u7b97\u7684\u5174\u8d77\uff0c\u5b9a\u65f6\u4efb\u52a1\u6280\u672f\u4e5f\u662f\u53d1\u5c55\u8fc5\u901f\uff0c\u4e0d\u4ec5\u80fd\u505a\u5355\u673a\u7684\u5b9a\u65f6\u4efb\u52a1\uff0c\u800c\u4e14\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e0b\u5e94\u7528\u4e5f\u5f88\u5e7f\u6cdb\uff0c\u6210\u4e3a\u4e86\u4e1a\u52a1\u505a\u515c\u5e95\u3001\u6570\u636e\u5904\u7406\u7684\u7b2c\u4e00\u9009\u62e9\u3002\u5b9a\u65f6\u4efb\u52a1\u4e3a\u4ec0\u4e48\u9700\u8981\u901a\u77e5\u5b9a\u65f6\u4efb\u52a1\u73b0\u5728\u5728\u4e1a\u52a1\u6570\u636e\u5904\u7406\u4e2d\u7684\u6bd4\u91cd\u8d8a\u6765\u8d8a\u91cd\uff0c\u5982\u679c\u4e1a\u52a1\u6570\u636e\u5904\u7406\u5931\u8d25\u4e86\uff0c\u9700\u8981\u53ca\u65f6\u901a\u77e5\u5230\u4e1a\u52a1\u65b9\uff0c\u786e\u4fdd\u4e86\u670d\u52a1\u7684\u53ef\u9760\u6027\u548c\u7a33\u5b9a\u6027\u3002\u540c\u65f6\uff0c\u597d\u7684\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u7cfb\u7edf\uff0c\u8fd8\u80fd\u5206\u6790\u4efb\u52a1\u5931\u8d25\u7684\u539f\u56e0\uff08\u6bd4\u5982\u5806\u6808\u4fe1\u606f\uff09\u5e76\u901a\u77e5\u7ed9\u4e1a\u52a1\u65b9\uff0c\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368103\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u6839\u636e\u901a\u77e5\u7684\u7c7b\u578b\uff0c\u5927\u6982\u53ef\u4ee5\u6709\u4ee5\u4e0b\u51e0\u7c7b\uff1a\u6210\u529f\u901a\u77e5\uff1a\u4efb\u52a1\u6267\u884c\u6210\u529f\uff0c\u628a\u7ed3\u679c\u901a\u77e5\u7ed9\u7528\u6237\u3002\u6bd4\u5982\u7edf\u8ba1\u524d\u4e00\u5929\u7684\u6570\u636e\u5e76\u628aGaaP\u7ed3\u679c\u901a\u8fc7\u77ed\u4fe1\u7b49\u6e20\u9053\u53d1\u9001\u7ed9\u5bf9\u5e94\u8d1f\u8d23\u4eba\u3002\u8d85\u65f6\u901a\u77e5\uff1a\u4efb\u52a1\u6267\u884c\u8d85\u65f6\uff0c\u901a\u77e5\u7528\u6237\u3002\u5931\u8d25\u901a\u77e5\uff1a\u4efb\u52a1\u6267\u884c\u5931\u8d25\uff0c\u901a\u77e5\u7528\u6237\u3002\u673a\u5668\u5f02\u5e38\u901a\u77e5\uff1a\u8fd0\u884c\u7684\u673a\u5668\u4e0b\u7ebf\u6216\u8005\u7e41\u5fd9\uff0c\u901a\u77e5\u7528\u6237\u3002\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u89e3\u51b3\u65b9\u6848\u81ea\u7814\u5b9a\u65f6\u4efb\u52a1\u62a5\u8b66\u901a\u77e5\u5982\u679c\u662f\u81ea\u7814\u7684\u5b9a\u65f6\u4efb\u52a1\u7cfb\u7edf\uff0c\u6216\u8005\u4f7f\u7528\u4e86\u5f00\u6e90\u5b9a\u65f6\u4efb\u52a1\u6846\u67b6\uff08\u6bd4\u5982Quartz\uff09\uff0c\u60f3\u8981\u589e\u52a0\u62a5\u8b66\u901a\u77e5\u80fd\u529b\uff0c\u6211\u4eec\u53ef\u4ee5\u91c7\u53d6\u4ec0\u4e48\u65b9\u6848\u5462\uff1f\u4ece\u5b9e\u65f6\u6027\u89d2\u5ea6\u6765\u770b\uff0c\u77ed\u4fe1\u548c\u7535\u8bdd\u901a\u77e5\u5b9e\u65f6\u6027\u6700\u9ad8\uff0c\u4f46\u662f\u8fd9\u4e24\u79cd\u65b9\u6848\u9700\u8981\u6bd4\u8f83\u5927\u7684\u6210\u672c\uff0c\u6bd4\u5982\u77ed\u4fe1\u901a\u77e5\u9700\u8981\u77ed\u4fe1\u5e73\u53f0\u3002\u5982\u679c\u6ca1\u6709\u77ed\u4fe1\u5e73\u53f0\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u91c7\u7528\u90ae\u4ef6\u548cwebhook\u901a\u77e5\u3002\u90ae\u4ef6\u6bcf\u4e2a\u90ae\u4ef6\u670d\u52a1\u5668\u90fd\u7531SMTP\u670d\u52a1\u5668\u548cPOP3\u670d\u52a1\u5668\u6784\u6210\uff0c\u5176\u4e2dSMTP\u670d\u52a1\u5668\u8d1f\u8d23\u53d1\u90ae\u4ef6\u7684\u8bf7\u6c42\uff0c\u800cPOP3\u8d1f\u8d23\u6536\u90ae\u4ef6\u7684\u8bf7\u6c42\u3002\u901a\u8fc7SMTP\u4e0ePOP3\u5373\u53ef\u5b9e\u73b0\u90ae\u4ef6\u7684\u6536\u53d1\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368104\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u90ae\u4ef6\u53d1\u9001\u539f\u7406\u56fe\u914d\u7f6e\u90ae\u4ef6\u670d\u52a1\u5668\u4ee5\u7f51\u6613163\u90ae\u4ef6\u4e3a\u4f8b\uff0c\u5728\u53d1\u9001\u65b9\u90ae\u7bb1\u8bbe\u7f6e\u91cc\uff0c\u5f00\u542fPOP3\/SMTP\u670d\u52a1<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368105\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u00a0\u4ee5Java\u4ee3\u7801\u4e3a\u4f8b\uff0c\u53d1\u9001\u90ae\u4ef6\u7684demoimport org.junit.Test;<br \/>import javax.mail.Message;<br \/>import javax.mail.Session;<br \/>import javax.mail.Transport;<br \/>import javax.mail.internet.InternetAddress;<br \/>import javax.mail.internet.MimeMessage;<br \/>import java.io.PrintWriter;<br \/>import java.io.StringWriter;<br \/>import java.util.Properties;<br \/>public class SendMailDemo {<\/p>\n<pre><code>public static void main(String[] args) throws Exception {\n    Properties prop = new Properties();\n    prop.setProperty(&quot;mail.host&quot;,&quot;smtp.163.com&quot;);\/\/\u8bbe\u7f6e\u53d1\u9001\u65b9\u90ae\u7bb1\u670d\u52a1\u5668\n    prop.setProperty(&quot;mail.transport.protocol&quot;,&quot;smtp&quot;);\/\/\u90ae\u4ef6\u53d1\u9001\u534f\u8bae\n    prop.setProperty(&quot;mail.smtp.auth&quot;,&quot;true&quot;);\/\/\u9700\u8981\u9a8c\u8bc1\u7528\u6237\u540d\u5bc6\u7801\n    Session session = Session.getDefaultInstance(prop);\n    Transport ts = session.getTransport();\n    String mailUser = &quot;xxx@163.com&quot;; \/\/\u90ae\u7bb1\u7684\u8d26\u53f7\n    String mailPasswd = &quot;123456789&quot;; \/\/\u90ae\u7bb1\u7684\u5bc6\u7801\n    ts.connect(&quot;smtp.163.com&quot;, mailUser, mailPasswd);\n    MimeMessage message = new MimeMessage(session);\n    message.setFrom(new InternetAddress(mailUser));\n    \/\/\u6536\u4ef6\u4eba\u7684\u90ae\u7bb1\u5730\u5740\n    message.setRecipient(Message.RecipientType.TO,new InternetAddress(&quot;xxxx@163.com&quot;));\n    \/\/\u90ae\u4ef6\u7684\u6807\u9898\n    message.setSubject(&quot;\u81ea\u5b9a\u4e49\u901a\u77e5&quot;);\n    message.setContent(&quot;&lt;h1 style='color:black'&gt;\u90ae\u4ef6\u901a\u77e5\u53d1\u9001\u6210\u529f!&lt;\/h1&gt;&quot;,&quot;text\/html;charset=UTF-8&quot;);\n    ts.sendMessage(message,message.getAllRecipients());\n    ts.close();\n}<\/code><\/pre>\n<p>}\u00a03. \u8fd0\u884c\u4e00\u6b21\uff0c\u53ef\u4ee5\u6536\u5230\u90ae\u4ef6<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368106\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>WebHook\u9489\u9489\u3001\u4f01\u4e1a\u5fae\u4fe1\u3001\u98de\u4e66\uff0c\u652f\u6301\u901a\u8fc7webhook\u65b9\u5f0f\u53d1\u9001\u901a\u77e5\u5230\u7fa4\u91cc\u3002\u4e0b\u9762\u4ee5\u9489\u9489webhook\u4e3a\u4f8b\u9996\u5148\u5728\u9489\u9489\u7fa4\u91cc\uff0c\u521b\u5efa\u4e00\u4e2a\u673a\u5668\u4eba\u7fa4\u8bbe\u7f6e-&gt;\u667a\u80fd\u7fa4\u52a9\u624b<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368107\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u6dfb\u52a0\u673a\u5668\u4eba-&gt;\u81ea\u5b9a\u4e49webhook\u63a5\u5165<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368108\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368109\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u00a0\u76f4\u63a5\u901a\u8fc7http\u8c03\u7528webhook\u94fe\u63a5\u5373\u53ef\uff0c\u4ee5Java\u4ee3\u7801\u4e3a\u4f8b\uff0cdemo\u5982\u4e0b\uff1a\/**<\/p>\n<ul>\n<li>@Auther: tangtao<\/li>\n<li>@Date: 2022\/8\/19 10:46<\/li>\n<li>@Description:\u53d1\u9001\u9489\u9489\u901a\u77e5<br \/> *\/<\/li>\n<\/ul>\n<p>public class WebhookDemo {<\/p>\n<pre><code>public static void main(String[] args) throws Exception {\n    CloseableHttpClient httpClient = HttpClientBuilder.create().build();\n    HttpPost httpPost = new HttpPost(&quot;https:\/\/oapi.dingtalk.com\/robot\/send?access_token=fcf4c30596a8b26d76a6d4dcd658b708066e23e877b285c784db2360660c97e0&quot;);\n    httpPost.setHeader(&quot;Content-Type&quot;, &quot;application\/json;charset=utf8&quot;);\n    JSONObject result = new JSONObject();\n    JSONObject text = new JSONObject();\n    text.put(&quot;content&quot;, &quot;\u6d4b\u8bd5\u9489\u9489\u53d1\u9001\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5&quot;);\n    result.put(&quot;text&quot;, text);\n    result.put(&quot;msgtype&quot;, &quot;text&quot;);\n    String jsonString = JSON.toJSONString(result);\n    StringEntity entity = new StringEntity(jsonString, &quot;UTF-8&quot;);\n    httpPost.setEntity(entity);\n    CloseableHttpResponse response = null;\n    response = httpClient.execute(httpPost);\n    HttpEntity responseEntity = response.getEntity();\n    System.out.println(&quot;\u54cd\u5e94\u7ed3\u679c:&quot; + EntityUtils.toString(responseEntity));\n}<\/code><\/pre>\n<p>}3. \u8fd0\u884c\u4e00\u6b21\uff0c\u53ef\u4ee5\u5728\u9489\u9489\u7fa4\u91cc\u770b\u5230\u901a\u77e5\u6d88\u606f<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368110\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u5f00\u6e90\u4efb\u52a1\u8c03\u5ea6\u7cfb\u7edf\u7684\u901a\u77e5\u89e3\u51b3\u65b9\u6848ElasticJobElasticJob\u662f\u4e00\u6b3e\u57fa\u4e8e Quartz \u5f00\u53d1\uff0c\u4f9d\u8d56 Zookeeper \u4f5c\u4e3a\u6ce8\u518c\u4e2d\u5fc3\u3001\u8f7b\u91cf\u7ea7\u3001\u65e0\u4e2d\u5fc3\u5316\u7684\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u6846\u67b6\uff0c\u76ee\u524d\u5df2\u7ecf\u901a\u8fc7 Apache \u5f00\u6e90\uff0c\u4f7f\u7528ElasticJob\u53ef\u4ee5\u5feb\u901f\u5b9e\u73b0\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u3002ElasticJob\u53ea\u9700\u914d\u7f6e\u5b9a\u65f6\u4efb\u52a1\u7684\u9519\u8bef\u5904\u7406\u7b56\u7565\u5373\u53ef\u5b9e\u73b0\u901a\u77e5\u529f\u80fd\u3002\u76ee\u524dElasticJob\u652f\u6301\u90ae\u4ef6\u3001\u9489\u9489\u3001\u5fae\u4fe1\u4e09\u79cd\u901a\u77e5\u6e20\u9053\u3002\u63a5\u5165\u6b65\u9aa4\u4ee5\u9489\u9489\u901a\u77e5\u4e3a\u4f8b\u5f15\u5165pom&lt;!&#8211; elastic job &#8211;&gt;<\/p>\n<pre><code>    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-starter&lt;\/artifactId&gt;\n        &lt;version&gt;2.2.0.RELEASE&lt;\/version&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n        &lt;version&gt;2.2.0.RELEASE&lt;\/version&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.apache.shardingsphere.elasticjob&lt;\/groupId&gt;\n        &lt;artifactId&gt;elasticjob-lite-spring-boot-starter&lt;\/artifactId&gt;\n        &lt;version&gt;3.0.0-RC1&lt;\/version&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.apache.shardingsphere.elasticjob&lt;\/groupId&gt;\n        &lt;artifactId&gt;elasticjob-error-handler-dingtalk&lt;\/artifactId&gt;\n        &lt;version&gt;3.0.0-RC1&lt;\/version&gt;\n    &lt;\/dependency&gt;\u65b0\u589eJob\/**<\/code><\/pre>\n<ul>\n<li>@Auther: tangtao<\/li>\n<li>@Date: 2022\/8\/17 14:33<\/li>\n<li>@Description: elastic job \u5931\u8d25\u540e\u53d1\u9001\u9489\u9489\u901a\u77e5<br \/> *\/<\/li>\n<\/ul>\n<p>@Component<br \/>public class ErrorNoticeDingtalkJob implements SimpleJob {<\/p>\n<pre><code>@Override\npublic void execute(final ShardingContext shardingContext) {\n    throw new RuntimeException(String.format(&quot;An exception has occurred in Job, The parameter is %s&quot;, shardingContext.getShardingParameter()));\n}<\/code><\/pre>\n<p>}\u5bf9\u5b9a\u65f6\u4efb\u52a1\u8fdb\u884c\u914d\u7f6ejobs:<\/p>\n<pre><code>errorNoticeDingtalkJob:\n  elasticJobClass: com.springboottemplate.elasticjob.job.ErrorNoticeDingtalkJob\n  overwrite: true\n  shardingTotalCount: 3\n  shardingItemParameters: 0=Beijing,1=Shanghai,2=Guangzhou\n  jobErrorHandlerType: DINGTALK\n  jobBootstrapBeanName: errorNoticeDingtalkBean\n  props:\n    dingtalk:\n      webhook: you_webhook\n      keyword: you_keyword\n      secret: you_secret\n      connectTimeout: 3000\n      readTimeout: 5000\u00a0\u901a\u77e5\u529f\u80fd\u7f3a\u70b9ElasticJob\u6ca1\u6709\u63d0\u4f9b\u63a7\u5236\u53f0\u6765\u914d\u7f6e\u5b9a\u65f6\u4efb\u52a1\u7684\u901a\u77e5\uff0c\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u9488\u5bf9\u6bcf\u4e2a\u4efb\u52a1\u5355\u72ec\u914d\u7f6e\uff0c\u914d\u7f6e\u6210\u672c\u6bd4\u8f83\u9ad8\u3002\u800c\u4e14\u60f3\u8981\u4fee\u6539\u5b9a\u65f6\u4efb\u52a1\u7684\u901a\u77e5\u914d\u7f6e\uff0c\u8fd8\u9700\u8981\u4fee\u6539\u914d\u7f6e\u91cd\u542f\u670d\u52a1\u624d\u80fd\u751f\u6548\uff0c\u53ef\u7ef4\u62a4\u6027\u4f4e\u3002XXL-JOBxxl-job\uff0c\u8fd9\u662f\u51fa\u81ea\u5927\u4f17\u7684\u5f00\u6e90\u9879\u76ee\uff0c\u5b98\u7f51\u4e0a\u4ecb\u7ecd\u8fd9\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u6846\u67b6\uff0c\u5176\u6838\u5fc3\u8bbe\u8ba1\u76ee\u6807\u662f\u5f00\u53d1\u8fc5\u901f\u3001\u5b66\u4e60\u7b80\u5355\u3001\u8f7b\u91cf\u7ea7\u3001\u6613\u6269\u5c55\uff0c\u4e0eSpringBoot\u6709\u975e\u5e38\u597d\u7684\u96c6\u6210\uff0c\u800c\u4e14\u76d1\u63a7\u754c\u9762\u5c31\u96c6\u6210\u5728\u8c03\u5ea6\u4e2d\u5fc3\uff0c\u754c\u9762\u53c8\u7b80\u6d01\uff0c\u5bf9\u4e8e\u4f01\u4e1a\u7ef4\u62a4\u8d77\u6765\u6210\u672c\u4e0d\u9ad8\uff0c\u9ed8\u8ba4\u652f\u6301\u5931\u8d25\u7684\u90ae\u4ef6\u544a\u8b66\u3002\u8fd9\u5c31\u4f7f\u5f88\u591a\u4f01\u4e1a\u9009\u62e9xxl-job\u505a\u8c03\u5ea6\u5e73\u53f0\u3002\u63a5\u5165\u6b65\u9aa4XXL-JOB\u9ed8\u8ba4\u652f\u6301\u5931\u8d25\u7684\u90ae\u4ef6\u544a\u8b66\uff0c\u53ea\u9700\u8981\u5728\u63a7\u5236\u53f0\u914d\u7f6e\u5bf9\u5e94\u90ae\u7bb1\u5373\u53ef\u3002<\/code><\/pre>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368111\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u90ae\u4ef6\u901a\u77e5\u4e5f\u8fdb\u884c\u4e86\u6392\u7248\uff1a<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368112\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u5176\u4ed6\u901a\u77e5\u6e20\u9053XXL-JOB\u53ef\u4ee5\u6269\u5c55\u77ed\u4fe1\u3001\u9489\u9489\u7b49\u65b9\u5f0f\uff0c\u4f46\u662f\u9700\u8981\u5f00\u53d1\u8005\u81ea\u5df1\u624b\u52a8\u5b9e\u73b0\u3002\u5982\u679c\u9700\u8981\u65b0\u589e\u4e00\u79cd\u544a\u8b66\u65b9\u5f0f\uff0c\u9700\u8981\u65b0\u589e\u4e00\u4e2a\u901a\u77e5\u7c7b\u5b9e\u73b0 \u201ccom.xxl.job.admin.core.alarm.JobAlarm\u201d \u63a5\u53e3\u5373\u53ef\u5bf9\u6bd4ElasticJobXXL-JOB\u53ef\u4ee5\u901a\u8fc7\u63a7\u5236\u53f0\u6765\u914d\u7f6e\u6bcf\u4e2a\u4efb\u52a1\u7684\u901a\u77e5\u914d\u7f6e\uff0c\u52a8\u6001\u751f\u6548\uff0c\u63a5\u5165\u6210\u672c\u4f4e\uff0c\u53ef\u7ef4\u62a4\u6027\u9ad8\uff0c\u6bd4ElasticJob\u65b9\u4fbf\u5f88\u591a\u3002\u4f46\u662f\u5f53\u524d\u7248\u672c\u63a7\u5236\u53f0\u53ea\u652f\u6301\u90ae\u4ef6\u901a\u77e5\uff0c\u90ae\u4ef6\u901a\u77e5\u54cd\u5e94\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u4e0d\u9002\u5408\u7528\u5728\u6838\u5fc3\u5728\u7ebf\u4e1a\u52a1\u7684\u5931\u8d25\u901a\u77e5\u3002\u4f01\u4e1a\u7ea7\u901a\u77e5\u89e3\u51b3\u65b9\u6848Schedulerx2.0\u901a\u77e5\u7ba1\u7406\u963f\u91cc\u4e91\u4efb\u52a1\u8c03\u5ea6SchedulerX2.0\u662f\u963f\u91cc\u5df4\u5df4\u81ea\u7814\u7684\u57fa\u4e8eAkka\u67b6\u6784\u7684\u4e00\u7ad9\u5f0f\u4efb\u52a1\u8c03\u5ea6\u5e73\u53f0\uff0c\u517c\u5bb9\u5f00\u6e90XXL-JOB\u3001ElasticJob\u3001Quartz\uff08\u89c4\u5212\u4e2d\uff09\uff0c\u63d0\u4f9b\u4e86\u5546\u4e1a\u7ea7\u7684\u901a\u77e5\u7ba1\u7406\u670d\u52a1\u3002\u901a\u77e5\u529f\u80fd\u7684\u4f18\u52bf\u76f8\u5bf9\u4e8eElasticJob\u3001XXL-JOB\u7b49\u5206\u5e03\u5f0f\u4efb\u52a1\u8c03\u5ea6\u6846\u67b6\u7684\u901a\u77e5\u529f\u80fd\u76f8\u6bd4\uff0cSchedulerX2.0\u901a\u77e5\u529f\u80fd\u5177\u6709\u4ee5\u4e0b\u51e0\u5927\u4f18\u52bf\uff1a<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368113\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u591a\u5143\u5316\u7684\u901a\u77e5\u901a\u9053\u00a0\u5f53\u524d\u652f\u6301\u77ed\u4fe1\u3001\u7535\u8bdd\u3001\u90ae\u7bb1\u3001webhook\uff08\u9489\u9489\u3001\u4f01\u4e1a\u5fae\u4fe1\u3001\u98de\u4e66\uff09\u3002\u4e30\u5bcc\u7684\u901a\u77e5\u7c7b\u578b\u4efb\u52a1\u6267\u884c\u5931\u8d25\u901a\u77e5\u4efb\u52a1\u6267\u884c\u8d85\u65f6\u901a\u77e5\u65e0\u53ef\u7528\u673a\u5668\u901a\u77e5\u673a\u5668\u7e41\u5fd9\u901a\u77e5\u4efb\u52a1\u6267\u884c\u7ed3\u679c\u901a\u77e5\u5feb\u901f\u54cd\u5e94\u00a0 \u00a0 \u00a0 \u901a\u77e5\u5185\u5bb9\u66f4\u5168\u9762\u3001\u66f4\u667a\u80fd\u7684\u901a\u77e5\u7ba1\u7406\u80fd\u529b\uff0c\u4f7f\u901a\u77e5\u7684\u54cd\u5e94\u53d8\u5f97\u66f4\u8fc5\u901f\uff0c\u63d0\u9ad8\u95ee\u9898\u89e3\u51b3\u7684\u901f\u5ea6\uff0c\u51cf\u5c11\u56e0\u4e1a\u52a1\u5f02\u5e38\u9020\u6210\u7684\u635f\u5931\u3002\u4ee5\u5931\u8d25\u901a\u77e5\u4e3a\u4f8b\uff0c\u901a\u77e5\u5185\u5bb9\u4e0d\u4ec5\u8bb0\u5f55\u4e86\u4efb\u52a1\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u8fd8\u8bb0\u5f55\u4e86\u5931\u8d25\u539f\u56e0\uff0c\u65b9\u4fbf\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368114\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368115\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368116\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u5f3a\u5927\u7684\u901a\u77e5\u67e5\u8be2\u529f\u80fdSchedulerX2.0\u652f\u6301\u67e5\u8be215\u5929\u5185\u901a\u77e5\u5386\u53f2\u8bb0\u5f55\uff0c\u6839\u636e\u5e94\u7528\u3001\u4efb\u52a1\u3001\u901a\u77e5\u7c7b\u578b\u3001\u901a\u77e5\u6e20\u9053\u7b49\u591a\u4e2a\u6761\u4ef6\u67e5\u8be2\u7684\u901a\u77e5\u4fe1\u606f\uff0c\u80fd\u4e3a\u4efb\u52a1\u7684\u65e5\u5e38\u7684\u7ef4\u62a4\u63d0\u4f9b\u53c2\u8003\u4e0e\u6307\u5bfc\u4f5c\u7528\u3002\u652f\u6301\u591a\u79cd\u901a\u77e5\u5bf9\u8c61Schedulerx2.0\u901a\u77e5\u7ba1\u7406\u76ee\u524d\u652f\u6301\u901a\u77e5\u8054\u7cfb\u4eba\u4e0e\u901a\u77e5\u8054\u7cfb\u4eba\u7ec4\u4e24\u79cd\u901a\u77e5\u5bf9\u8c61\u3002Schedulerx2.0\u5bf9\u901a\u77e5\u8054\u7cfb\u4eba\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u8eab\u9700\u8981\u7075\u6d3b\u7684\u914d\u7f6e\u4efb\u52a1\u7684\u901a\u77e5\u5bf9\u8c61\uff0c\u51cf\u5c11\u4e86\u901a\u77e5\u5bf9\u8c61\u914d\u7f6e\u7684\u590d\u6742\u5ea6\u3002\u914d\u7f6e\u7b80\u5355\u3001\u5b66\u4e60\u6210\u672c\u4f4eSchedulerX2.0\u65e0\u9700\u7528\u6237\u65b0\u589e\u4efb\u4f55\u4ee3\u7801\uff0c\u5728\u63a7\u5236\u53f0\u4e0a\u5373\u53ef\u5b8c\u6210\u6240\u6709\u7684\u62a5\u8b66\u901a\u77e5\u914d\u7f6e\uff0c\u4e0a\u624b\u901f\u5ea6\u5feb\u3001\u96be\u5ea6\u4f4e\u3001\u5b66\u4e60\u6210\u672c\u51e0\u4e4e\u4e3a\u96f6\u3002\u4f4e\u6210\u672c\u4e0e\u514d\u8fd0\u7ef4Schedulerx2.0\u901a\u77e5\u7ba1\u7406\u529f\u80fd\u4e0d\u6536\u53d6\u4efb\u4f55\u8d39\u7528\u3002\u5176\u66f4\u667a\u80fd\u3001\u66f4\u5168\u9762\u7684\u901a\u77e5\u7ba1\u7406\u80fd\u529b\u53ef\u4ee5\u6709\u6548\u964d\u4f4e\u7cfb\u7edf\u7684\u8fd0\u7ef4\u6210\u672c\u548c\u8fd0\u7ef4\u4eba\u5458\u7684\u65f6\u95f4\u6210\u672c\u3002\u901a\u77e5\u529f\u80fd\u6838\u5fc3\u6d41\u7a0b\u5b9a\u65f6\u4efb\u52a1\u5728\u67d0\u79cd\u72b6\u6001\u4e0b\u4f1a\u89e6\u53d1\u901a\u77e5\uff0c\u901a\u8fc7\u63a5\u5165\u5c42\u7684\u7edf\u4e00Api\u5c06\u901a\u77e5\u4fe1\u606f\u53d1\u9001\u7ed9SchedulerX2.0\u7684\u901a\u77e5\u7ba1\u7406\u5e73\u53f0\u3002\u901a\u77e5\u7ba1\u7406\u5e73\u53f0\u5bf9\u901a\u77e5\u8fdb\u884c\u63a5\u6536\u3001\u4fdd\u5b58\u3002\u518d\u57fa\u4e8e\u4efb\u52a1\u7684\u901a\u77e5\u914d\u7f6e\u89c4\u5219\u4ee5\u90ae\u4ef6\u3001\u77ed\u4fe1\u3001\u8bed\u97f3\u7b49\u65b9\u5f0f\u5c06\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u63a8\u9001\u7ed9\u7528\u6237\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368117\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u5982\u4f55\u914d\u7f6e\u901a\u77e5\u914d\u7f6e\u8054\u7cfb\u4eba\u7ec4\u76ee\u524dSchedulerx2.0\u7684\u5b9a\u65f6\u4efb\u52a1\u9ed8\u8ba4\u4f7f\u7528\u7684\u662f\u5e94\u7528\u7684\u901a\u77e5\u6e20\u9053\u4e0e\u8054\u7cfb\u4eba\u3002\u60f3\u8981\u914d\u7f6e\u4efb\u52a1\u7684\u901a\u77e5\u6e20\u9053\u4e0e\u8054\u7cfb\u4eba\u53ea\u9700\u8981\u914d\u7f6e\u5bf9\u5e94\u5e94\u7528\u7684\u901a\u77e5\u6e20\u9053\u4ee5\u53ca\u901a\u77e5\u8054\u7cfb\u4eba\u5373\u53ef\u3002\u65b0\u589e\u8054\u7cfb\u4eba\u767b\u5f55Schedulerx2.0\u63a7\u5236\u53f0&gt;\u901a\u77e5\u7ba1\u7406&gt;\u901a\u77e5\u8054\u7cfb\u4eba\u3002\u5728\u8054\u7cfb\u4eba\u9875\u7b7e\uff0c\u5355\u51fb\u65b0\u5efa\u8054\u7cfb\u4eba\uff0c\u586b\u5199\u8054\u7cfb\u4eba\u76f8\u5173\u4fe1\u606f\u5373\u53ef\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368118\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u00a0\u00a02. \u00a0\u65b0\u589e\u8054\u7cfb\u4eba\u7ec4\u767b\u5f55Schedulerx2.0\u63a7\u5236\u53f0&gt;\u901a\u77e5\u7ba1\u7406&gt;\u901a\u77e5\u8054\u7cfb\u4eba\u3002\u5728\u8054\u7cfb\u4eba\u7ec4\u9875\u7b7e\uff0c\u5355\u51fb\u65b0\u5efa\u8054\u7cfb\u7ec4\uff0c\u586b\u5199\u7ec4\u540d\u79f0\uff0c\u7ed1\u5b9a\u8054\u7cfb\u4eba\u5373\u53ef\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368119\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u5e94\u7528\u7ed1\u5b9a\u8054\u7cfb\u4eba\u7ec4\u00a0\u767b\u5f55Schedulerx2.0\u63a7\u5236\u53f0&gt;\u5e94\u7528\u7ba1\u7406\u3002\u627e\u5230\u5bf9\u5e94\u7684\u5e94\u7528\uff0c\u5728\u901a\u77e5\u914d\u7f6e\u4e2d\u7ed1\u5b9a\u5bf9\u5e94\u7684\u901a\u77e5\u8054\u7cfb\u4eba\u7ec4\u5373\u53ef\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368120\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u914d\u7f6e\u901a\u77e5\u7c7b\u578b\u767b\u5f55Schedulerx2.0\u63a7\u5236\u53f0&gt;\u4efb\u52a1\u7ba1\u7406\u3002\u65b0\u589e\u6216\u8005\u7f16\u8f91\u4efb\u52a1\u65f6\u5019\uff0c\u5728\u901a\u77e5\u914d\u7f6e\u4e2d\u9009\u62e9\u5bf9\u5e94\u7684\u901a\u77e5\u7c7b\u578b\u5373\u53ef\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368121\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u901a\u77e5\u8bb0\u5f55\u67e5\u8be2SchedulerX2.0\u652f\u6301\u67e5\u8be215\u5929\u5185\u901a\u77e5\u8bb0\u5f55\uff0c\u6839\u636e\u8bb0\u5f55\u7684\u4efb\u52a1\u62a5\u8b66\u4fe1\u606f\u4e0e\u901a\u77e5\u4fe1\u606f\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4e86\u89e3\u5230\u4efb\u52a1\u4e00\u6bb5\u65f6\u95f4\u5185\u7684\u5065\u5eb7\u72b6\u6001\uff0c\u80fd\u4e3a\u4efb\u52a1\u7684\u65e5\u5e38\u7684\u7ef4\u62a4\u63d0\u4f9b\u53c2\u8003\u4e0e\u6307\u5bfc\u4f5c\u7528\u3002<br \/><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/remote\/1460000042368122\" alt=\"\u56fe\u7247\" title=\"\u56fe\u7247\" loading=\"lazy\"><br \/>\u4e0e\u5f00\u6e90\u65b9\u6848\u7684\u5bf9\u6bd4\u00a0XXL-JOBElasticJobSchedulerX\u901a\u77e5\u6e20\u9053\u90ae\u7bb1\u90ae\u7bb1\u3001\u9489\u9489\u3001\u4f01\u4e1a\u5fae\u4fe1\u77ed\u4fe1\u3001\u7535\u8bdd\u3001\u90ae\u7bb1\u3001webhook\uff08\u9489\u9489\u3001\u98de\u4e66\u3001\u4f01\u4e1a\u5fae\u4fe1\uff09\u53ef\u89c6\u5316\u914d\u7f6e\u652f\u6301\u4e0d\u652f\u6301\u652f\u6301\u901a\u77e5\u7c7b\u578b\u5931\u8d25\u901a\u77e5\u5931\u8d25\u901a\u77e5\u6210\u529f\u901a\u77e5\u5931\u8d25\u901a\u77e5\u8d85\u65f6\u901a\u77e5\u673a\u5668\u4e0d\u53ef\u7528\u901a\u77e5\u7b49\u8054\u7cfb\u4eba\u7ec4\u4e0d\u652f\u6301\u4e0d\u652f\u6301\u652f\u6301\u901a\u77e5\u8bb0\u5f55\u67e5\u8be2\u4e0d\u652f\u6301\u4e0d\u652f\u6301\u652f\u6301\u539f\u6587\u94fe\u63a5\uff1a<a href=\"https:\/\/link.segmentfault.com\/?enc=%2FgfcJcAeaGUbRPQ1dNUwLQ%3D%3D.AiMWaVINTTQ8nydGMrGEdhnod6jvgIP4pbJue5EMiLSNFqRH6G47jLA90J7a%2FE%2FU\" rel=\"nofollow\">https:\/\/click.aliyun.com\/m\/10&#8230;<\/a>\u672c\u6587\u4e3a\u963f\u91cc\u4e91\u539f\u521b\u5185\u5bb9\uff0c\u672a\u7ecf\u5141\u8bb8\u4e0d\u5f97\u8f6c\u8f7d\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000042368101\">https:\/\/segmentfault.com\/a\/1190000042368101<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u4ecb\uff1a\u00a0\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u4ee5\u53ca\u5e02\u9762\u4e0a\u5e38\u89c1\u7684\u5f00\u6e90\u5b9a\u65f6\u4efb\u52a1\u901a\u77e5\u65b9\u6848\u5bf9\u6bd4\u3002\u4ec0\u4e48\u662f\u5b9a\u65f6\u4efb\u52a1\u5b9a\u65f6\u4efb\u52a1\u662f [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10006298","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10006298"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10006298\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10006298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10006298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10006298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}