{"id":150,"date":"2023-02-27T00:17:58","date_gmt":"2023-02-26T16:17:58","guid":{"rendered":"http:\/\/codermr.com\/?p=150"},"modified":"2023-03-27T20:32:43","modified_gmt":"2023-03-27T12:32:43","slug":"xxl-job1","status":"publish","type":"post","link":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/","title":{"rendered":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09"},"content":{"rendered":"\n<p>\u672c\u6765\u60f3\u5206\u4e09\u7bc7\u6587\u7ae0\u6765\u8be6\u7ec6\u8bb2\u89e3\u548c\u5206\u6790 xxl-job \uff0c\u4f46\u6700\u8fd1\u8f83\u5fd9\uff0c\u7efc\u5408\u5199\u5728\u4e00\u7bc7\u91cc\u9762\u4e86\uff0c\u6240\u4ee5\u672c\u6587\u4e0d\u518d\u8bb2\u8ff0\u5b9a\u65f6\u4efb\u52a1\u3001\u5206\u5e03\u5f0f\u8c03\u5ea6\u4e2d\u5fc3\u3001quartz\u3001Cron \u7b49\u8fd9\u4e9b\u57fa\u672c\u6982\u5ff5\uff0c\u60f3\u66f4\u591a\u4e86\u89e3 xxl-job \u7684\u8bbe\u8ba1\u548c\u601d\u60f3\uff0c\u8bf7\u8bbf\u95ee <a href=\"https:\/\/www.xuxueli.com\/xxl-job\/\">xxl-job\u5b98\u7f51<\/a> \uff0c\u672c\u6587\u4e3b\u8981\u5206\u6790 xxl-job \u7684\u6e90\u7801 \u3002<\/p>\n\n\n\n<p>xxl-job \u7684\u67b6\u6784\u8bbe\u8ba1\u4e3b\u8981\u5305\u62ec\u4e24\u90e8\u5206\uff1a<strong>\u6267\u884c\u5668<\/strong>\u548c<strong>\u8c03\u5ea6\u4e2d\u5fc3<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6267\u884c\u5668<\/h3>\n\n\n\n<p>\u4f60\u9879\u76ee\u4e2d\u7684\u4e00\u6bb5\u4e1a\u52a1\u4ee3\u7801\uff0c\u60f3\u88ab xxl-job \u8c03\u5ea6\uff0c\u5c31\u5fc5\u987b\u5f15\u5165 xxl-job \u7684 core \u5305\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    &lt;!-- http:\/\/repo1.maven.org\/maven2\/com\/xuxueli\/xxl-job-core\/ --&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;com.xuxueli&lt;\/groupId&gt;\n        &lt;artifactId&gt;xxl-job-core&lt;\/artifactId&gt;\n        &lt;version&gt;${\u6700\u65b0\u7a33\u5b9a\u7248\u672c}&lt;\/version&gt;\n    &lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<p>\u5e76\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6307\u5b9a\u8c03\u5ea6\u4e2d\u5fc3\u7684\u5730\u5740\uff08\u652f\u6301 .properties \u6216 .yaml \u683c\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6\uff09\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>### \u8c03\u5ea6\u4e2d\u5fc3\u90e8\u7f72\u6839\u5730\u5740 &#91;\u9009\u586b]\uff1a\u5982\u8c03\u5ea6\u4e2d\u5fc3\u96c6\u7fa4\u90e8\u7f72\u5b58\u5728\u591a\u4e2a\u5730\u5740\u5219\u7528\u9017\u53f7\u5206\u9694\u3002\u6267\u884c\u5668\u5c06\u4f1a\u4f7f\u7528\u8be5\u5730\u5740\u8fdb\u884c\"\u6267\u884c\u5668\u5fc3\u8df3\u6ce8\u518c\"\u548c\"\u4efb\u52a1\u7ed3\u679c\u56de\u8c03\"\uff1b\u4e3a\u7a7a\u5219\u5173\u95ed\u81ea\u52a8\u6ce8\u518c\uff1b\nxxl.job.admin.addresses=http:\/\/127.0.0.1:8080\/xxl-job-admin\n### \u6267\u884c\u5668\u901a\u8bafTOKEN &#91;\u9009\u586b]\uff1a\u975e\u7a7a\u65f6\u542f\u7528\uff1b\nxxl.job.accessToken=\n### \u6267\u884c\u5668AppName &#91;\u9009\u586b]\uff1a\u6267\u884c\u5668\u5fc3\u8df3\u6ce8\u518c\u5206\u7ec4\u4f9d\u636e\uff1b\u4e3a\u7a7a\u5219\u5173\u95ed\u81ea\u52a8\u6ce8\u518c\nxxl.job.executor.appname=xxl-job-executor-sample\n### \u6267\u884c\u5668\u6ce8\u518c &#91;\u9009\u586b]\uff1a\u4f18\u5148\u4f7f\u7528\u8be5\u914d\u7f6e\u4f5c\u4e3a\u6ce8\u518c\u5730\u5740\uff0c\u4e3a\u7a7a\u65f6\u4f7f\u7528\u5185\u5d4c\u670d\u52a1 \u201dIP:PORT\u201c \u4f5c\u4e3a\u6ce8\u518c\u5730\u5740\u3002\u4ece\u800c\u66f4\u7075\u6d3b\u7684\u652f\u6301\u5bb9\u5668\u7c7b\u578b\u6267\u884c\u5668\u52a8\u6001IP\u548c\u52a8\u6001\u6620\u5c04\u7aef\u53e3\u95ee\u9898\u3002\nxxl.job.executor.address=\n### \u6267\u884c\u5668IP &#91;\u9009\u586b]\uff1a\u9ed8\u8ba4\u4e3a\u7a7a\u8868\u793a\u81ea\u52a8\u83b7\u53d6IP\uff0c\u591a\u7f51\u5361\u65f6\u53ef\u624b\u52a8\u8bbe\u7f6e\u6307\u5b9aIP\uff0c\u8be5IP\u4e0d\u4f1a\u7ed1\u5b9aHost\u4ec5\u4f5c\u4e3a\u901a\u8baf\u5b9e\u7528\uff1b\u5730\u5740\u4fe1\u606f\u7528\u4e8e \"\u6267\u884c\u5668\u6ce8\u518c\" \u548c \"\u8c03\u5ea6\u4e2d\u5fc3\u8bf7\u6c42\u5e76\u89e6\u53d1\u4efb\u52a1\"\uff1b\nxxl.job.executor.ip=\n### \u6267\u884c\u5668\u7aef\u53e3\u53f7 &#91;\u9009\u586b]\uff1a\u5c0f\u4e8e\u7b49\u4e8e0\u5219\u81ea\u52a8\u83b7\u53d6\uff1b\u9ed8\u8ba4\u7aef\u53e3\u4e3a9999\uff0c\u5355\u673a\u90e8\u7f72\u591a\u4e2a\u6267\u884c\u5668\u65f6\uff0c\u6ce8\u610f\u8981\u914d\u7f6e\u4e0d\u540c\u6267\u884c\u5668\u7aef\u53e3\uff1b\nxxl.job.executor.port=9999\n### \u6267\u884c\u5668\u8fd0\u884c\u65e5\u5fd7\u6587\u4ef6\u5b58\u50a8\u78c1\u76d8\u8def\u5f84 &#91;\u9009\u586b] \uff1a\u9700\u8981\u5bf9\u8be5\u8def\u5f84\u62e5\u6709\u8bfb\u5199\u6743\u9650\uff1b\u4e3a\u7a7a\u5219\u4f7f\u7528\u9ed8\u8ba4\u8def\u5f84\uff1b\nxxl.job.executor.logpath=\/data\/applogs\/xxl-job\/jobhandler\n### \u6267\u884c\u5668\u65e5\u5fd7\u6587\u4ef6\u4fdd\u5b58\u5929\u6570 &#91;\u9009\u586b] \uff1a \u8fc7\u671f\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406, \u9650\u5236\u503c\u5927\u4e8e\u7b49\u4e8e3\u65f6\u751f\u6548; \u5426\u5219, \u5982-1, \u5173\u95ed\u81ea\u52a8\u6e05\u7406\u529f\u80fd\uff1b\nxxl.job.executor.logretentiondays=30<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u521d\u59cb\u5316 XxlJobSpringExecutor \u5bf9\u8c61\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Bean\npublic XxlJobSpringExecutor xxlJobExecutor() {\n    logger.info(\"&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; xxl-job config init.\");\n    XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();\n    xxlJobSpringExecutor.setAdminAddresses(adminAddresses);\n    xxlJobSpringExecutor.setAppname(appname);\n    xxlJobSpringExecutor.setAddress(address);\n    xxlJobSpringExecutor.setIp(ip);\n    xxlJobSpringExecutor.setPort(port);\n    xxlJobSpringExecutor.setAccessToken(accessToken);\n    xxlJobSpringExecutor.setLogPath(logPath);\n    xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);\n\n    return xxlJobSpringExecutor;\n}<\/code><\/pre>\n\n\n\n<p>\u81f3\u6b64\uff0c\u4f60\u7684\u9879\u76ee\u5df2\u7ecf\u6210\u4e3a\u4e00\u4e2a\u6267\u884c\u5668\uff0c\u53ef\u4ee5\u8ddf\u8c03\u5ea6\u4e2d\u5fc3\u901a\u4fe1\u4e86\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8c03\u5ea6\u4e2d\u5fc3<\/h3>\n\n\n\n<p>\u5728 xxl-job \u5b98\u65b9\u63d0\u4f9b\u7684\u6e90\u7801\u4e2d\uff0c\u6709\u4e00\u4e2a admin \u9879\u76ee\uff0c\u8be5\u9879\u76ee\u5c31\u662f\u8c03\u5ea6\u4e2d\u5fc3\uff0c\u8c03\u5ea6\u4e2d\u5fc3\u652f\u6301\u96c6\u7fa4\u90e8\u7f72\uff0c\u96c6\u7fa4\u60c5\u51b5\u4e0b\u5404\u8282\u70b9\u52a1\u5fc5\u8fde\u63a5\u540c\u4e00\u4e2a mysql \u5b9e\u4f8b\u3002\u5148\u6267\u884c xxl-job \u63d0\u4f9b\u7684\u521d\u59cb\u5316 sql \uff0c\u7136\u540e\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u6570\u636e\u5e93\u7b49\u914d\u7f6e\u4fe1\u606f\u4e3a\u81ea\u5df1\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>### \u8c03\u5ea6\u4e2d\u5fc3JDBC\u94fe\u63a5\uff1a\u94fe\u63a5\u5730\u5740\u8bf7\u4fdd\u6301\u548c 2.1\u7ae0\u8282 \u6240\u521b\u5efa\u7684\u8c03\u5ea6\u6570\u636e\u5e93\u7684\u5730\u5740\u4e00\u81f4\nspring.datasource.url=jdbc:mysql:\/\/127.0.0.1:3306\/xxl_job?useUnicode=true&amp;characterEncoding=UTF-8&amp;autoReconnect=true&amp;serverTimezone=Asia\/Shanghai\nspring.datasource.username=root\nspring.datasource.password=root_pwd\nspring.datasource.driver-class-name=com.mysql.jdbc.Driver\n### \u62a5\u8b66\u90ae\u7bb1\nspring.mail.host=smtp.qq.com\nspring.mail.port=25\nspring.mail.username=xxx@qq.com\nspring.mail.password=xxx\nspring.mail.properties.mail.smtp.auth=true\nspring.mail.properties.mail.smtp.starttls.enable=true\nspring.mail.properties.mail.smtp.starttls.required=true\nspring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory\n### \u8c03\u5ea6\u4e2d\u5fc3\u901a\u8bafTOKEN &#91;\u9009\u586b]\uff1a\u975e\u7a7a\u65f6\u542f\u7528\uff1b\nxxl.job.accessToken=\n### \u8c03\u5ea6\u4e2d\u5fc3\u56fd\u9645\u5316\u914d\u7f6e &#91;\u5fc5\u586b]\uff1a \u9ed8\u8ba4\u4e3a \"zh_CN\"\/\u4e2d\u6587\u7b80\u4f53, \u53ef\u9009\u8303\u56f4\u4e3a \"zh_CN\"\/\u4e2d\u6587\u7b80\u4f53, \"zh_TC\"\/\u4e2d\u6587\u7e41\u4f53 and \"en\"\/\u82f1\u6587\uff1b\nxxl.job.i18n=zh_CN\n## \u8c03\u5ea6\u7ebf\u7a0b\u6c60\u6700\u5927\u7ebf\u7a0b\u914d\u7f6e\u3010\u5fc5\u586b\u3011\nxxl.job.triggerpool.fast.max=200\nxxl.job.triggerpool.slow.max=100\n### \u8c03\u5ea6\u4e2d\u5fc3\u65e5\u5fd7\u8868\u6570\u636e\u4fdd\u5b58\u5929\u6570 &#91;\u5fc5\u586b]\uff1a\u8fc7\u671f\u65e5\u5fd7\u81ea\u52a8\u6e05\u7406\uff1b\u9650\u5236\u5927\u4e8e\u7b49\u4e8e7\u65f6\u751f\u6548\uff0c\u5426\u5219, \u5982-1\uff0c\u5173\u95ed\u81ea\u52a8\u6e05\u7406\u529f\u80fd\uff1b\nxxl.job.logretentiondays=30<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u542f\u52a8 admin \u9879\u76ee\u5373\u53ef\u770b\u5230 xxl-job \u8c03\u5ea6\u4e2d\u5fc3\u7684\u9875\u9762\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2672\" height=\"1414\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image.png\" alt=\"\" class=\"wp-image-805\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image.png 2672w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-300x159.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1024x542.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-768x406.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1536x813.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2048x1084.png 2048w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1222x647.png 1222w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-922x488.png 922w\" sizes=\"(max-width: 2672px) 100vw, 2672px\" \/><\/a><figcaption class=\"wp-element-caption\">\u81f3\u6b64\uff0c\u6267\u884c\u5668\u6211\u4eec\u5df2\u7ecf\u914d\u7f6e\u8fc7\u4e86\uff0c\u8c03\u5ea6\u4e2d\u5fc3\u4e5f\u542f\u52a8\u6210\u529f\u4e86\uff0c\u7136\u540e\u5728\u6267\u884c\u5668\u4e2d\u6dfb\u52a0\u4e00\u6bb5\u4ee3\u7801\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5c06\u88ab\u8c03\u5ea6\u4e2d\u5fc3\u8c03\u5ea6\uff08<strong>\u672c\u6587\u53ea\u5206\u6790\u8fd0\u884c\u6a21\u5f0f\u4e3a Bean \u6a21\u5f0f\u7684\u6e90\u7801<\/strong>\uff09\uff0c\u8fd9\u6bb5\u4ee3\u7801\u5982\u4e0b\uff1a<\/figcaption><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>@Component\npublic class BeanMethodXxlJob {\n\n    @XxlJob(\"ptHandler\")\n    public ReturnT&lt;String&gt; ptJobHandler(String param) throws Exception {\n        JobLogger.log(\"XXL-JOB, Hello World.\");\n        JobLogger.log(\"======ptHandler:{}\", param);\n        return ReturnT.SUCCESS;\n    }\n\n}<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u5728\u8c03\u5ea6\u4e2d\u5fc3\u4e2d\u914d\u7f6e\u8be5\u5b9a\u65f6\u4efb\u52a1\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1.png\" alt=\"\" class=\"wp-image-806\" width=\"421\" height=\"221\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1.png 1684w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-300x157.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-1024x536.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-768x402.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-1536x804.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-1222x640.png 1222w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-1-922x483.png 922w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/a><\/figure>\n\n\n\n<p>\u914d\u7f6e\u6210\u529f\u4e4b\u540e\uff0c\u5c06\u4f1a\u5728 xxl-job \u63a7\u5236\u53f0\u7684 &#8220;\u4efb\u52a1\u7ba1\u7406&#8221; \u91cc\u9762\u770b\u5230\u5927\u81f4\u5982\u4e0b\u754c\u9762\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12.png\" alt=\"\" class=\"wp-image-654\" width=\"614\" height=\"100\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12.png 3252w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-300x49.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-1024x168.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-768x126.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-1536x252.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-2048x336.png 2048w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-12-816x134.png 816w\" sizes=\"(max-width: 614px) 100vw, 614px\" \/><\/a><\/figure>\n\n\n\n<p>\u6bcf\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\uff0c\u5bf9\u5e94 xxl_job_info \u8868\u4e2d\u7684\u4e00\u6761\u8bb0\u5f55\uff0c\u5bf9\u5e94\u7684\u5bf9\u8c61\u662f XxlJobInfo \u5bf9\u8c61\u3002\u7136\u540e xxl-job \u5c31\u53ef\u4ee5\u4e3a\u6211\u4eec\u6240\u7528\u4e86\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u4e0b\u9762\uff0c\u6211\u4eec\u8981\u601d\u8003\u7684\u95ee\u9898\u662f\uff1a<\/p>\n\n\n\n<ul>\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">xxl-job \u7684\u6267\u884c\u5668\u548c\u8c03\u5ea6\u4e2d\u5fc3\u662f\u600e\u4e48\u901a\u4fe1\u7684\uff1f<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u8c03\u5ea6\u4e2d\u5fc3\u662f\u5982\u4f55\u8c03\u5ea6\u4e0d\u540c\u7684\u5b9a\u65f6\u4efb\u52a1\u7684\uff1f<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u6267\u884c\u5668\u662f\u600e\u4e48\u628a\u81ea\u5df1\u6ce8\u518c\u5230\u8c03\u5ea6\u4e2d\u5fc3\u4e0a\u7684\uff1f<\/mark><\/strong><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">&#8230;&#8230;<\/mark><\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u4e0b\u9762\u4e00\u6b65\u6b65\u5206\u6790\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8c03\u5ea6\u4e2d\u5fc3\u662f\u600e\u4e48\u77e5\u9053\u90fd\u6709\u54ea\u4e9b\u5b9a\u65f6\u4efb\u52a1\u7684\u5462\uff1f<\/h3>\n\n\n\n<p>\u8fd8\u8bb0\u5f97\u4e0a\u9762\u63d0\u5230\u6267\u884c\u5668\u9700\u8981\u914d\u7f6e XxlJobSpringExecutor \u5417\uff0c\u8fd9\u4e2a XxlJobSpringExecutor \u5c31\u662f\u6267\u884c\u5668\u7684\u5165\u53e3\uff0c\u5728\u6267\u884c\u5668\u9879\u76ee\u542f\u52a8\u4e4b\u540e\uff0cXxlJobSpringExecutor \u4e2d\u7684 initJobHandlerMethodRepository \u65b9\u6cd5\u4f1a\u626b\u63cf\u6267\u884c\u5668\u9879\u76ee\u4e2d\u6240\u6709\u52a0\u4e86&nbsp;&nbsp;@XxlJob&nbsp;\u6ce8\u89e3\u7684\u65b9\u6cd5\uff0c\u8fd9\u91cc\u9700\u8981\u8bf4\u4e00\u4e0b @XxlJob \u8fd9\u4e2a\u6ce8\u89e3\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Target({ElementType.METHOD})\n@Retention(RetentionPolicy.RUNTIME)\n@Inherited\npublic @interface XxlJob {\n\n    \/**\n     * jobhandler name\n     *\/\n    String value();\n\n    \/**\n     * init handler, invoked when JobThread init\n     *\/\n    String init() default \"\";\n\n    \/**\n     * destroy handler, invoked when JobThread destroy\n     *\/\n    String destroy() default \"\";\n\n}<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u7684 value() \u503c\u662f\u6211\u4eec\u5b9a\u4e49\u7684 jobHandler \u540d\u5b57\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u5177\u4f53\u6765\u8bf4\uff0c\u4f1a\u5148\u626b\u63cf\u6240\u6709\u88ab Spring \u7ba1\u7406\u7684 Bean \u5bf9\u8c61\uff0c\u7136\u540e\u5bf9\u4e8e\u6bcf\u4e2a Bean \u5bf9\u8c61\u7684\u6bcf\u4e2a\u65b9\u6cd5\uff0c\u90fd\u4f1a\u8fdb\u884c\u626b\u63cf\u5e76\u5224\u65ad\u8be5\u65b9\u6cd5\u662f\u5426\u52a0\u4e86 @XxlJob \u6ce8\u89e3\uff0c\u5982\u679c\u52a0\u4e86\uff0c\u5219\u4f1a\u6839\u636e @XxlJob \u6ce8\u89e3\u7684\u503c\u3001\u8be5 Bean \u5bf9\u8c61\u7b49\u6765\u521b\u5efa\u4e00\u4e2a MethodJobHandler \u5bf9\u8c61\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-15.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-15.png\" alt=\"\" class=\"wp-image-662\" width=\"642\" height=\"525\"\/><\/a><\/figure>\n\n\n\n<p>\u7136\u540e\u8c03\u7528\u7236\u7c7b\uff08com.xxl.job.core.executor.XxlJobExecutor#registJobHandler\uff09\u65b9\u6cd5\u5c06 jobHandler\uff08\u5373\u6211\u4eec\u7684\u5b9a\u65f6\u4efb\u52a1\uff09\u6ce8\u518c\u5230\u8c03\u5ea6\u4e2d\u5fc3\u4e0a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>registJobHandler(name, new MethodJobHandler(bean, method, initMethod, destroyMethod));<\/code><\/pre>\n\n\n\n<p>\u5230\u8fd9\u4e00\u6b65\u5176\u5b9e\u53ea\u662f\u5c06 jobHandler \u653e\u8fdb\u4e00\u4e2a Map \u4e2d\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16.png\" alt=\"\" class=\"wp-image-663\" width=\"642\" height=\"99\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16.png 1970w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16-300x46.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16-1024x157.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16-768x118.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16-1536x236.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/image-16-816x126.png 816w\" sizes=\"(max-width: 642px) 100vw, 642px\" \/><\/a><\/figure>\n\n\n\n<p>\u653e\u8fdb Map \u4e2d\u7684\u76ee\u7684\u5c31\u662f\u4e3a\u4e86\u65b9\u4fbf\u7edf\u4e00\u7ba1\u7406\uff08\u5982\u4e00\u6b21 load \u5168\u90e8 MethodJobHandler \u3001clear \u6389\u5168\u90e8 MethodJobHandler \uff0c\u8be5 Map \u5728 <strong>com.xxl.job.core.biz.impl.ExecutorBizImpl#run <\/strong>\u65b9\u6cd5\u4e2d\u4f1a\u7528\u5230\uff09\u3002<\/p>\n\n\n\n<p>\u7136\u540e XxlJobSpringExecutor \u4f1a\u6267\u884c super.start() \u65b9\u6cd5\u5373\u8c03\u7528\u7236\u7c7b\u7684 start() \u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public void start() throws Exception {\n    \/\/ init logpath\n    XxlJobFileAppender.initLogPath(logPath);\n\n    \/\/ init invoker, admin-client  \u2588\u521d\u59cb\u5316admin\u7684\u5ba2\u6237\u7aef\u2588\n    initAdminBizList(adminAddresses, accessToken);\n\n    \/\/ init JobLogFileCleanThread  \u521d\u59cb\u5316\u65e5\u5fd7\u6e05\u7406\u7ebf\u7a0b\n    JobLogFileCleanThread.getInstance().start(logRetentionDays);\n\n    \/\/ init TriggerCallbackThread  \u521d\u59cb\u5316\u56de\u8c03\u7ebf\u7a0b\u6c60\n    TriggerCallbackThread.getInstance().start();\n\n    \/\/ init executor-server  \u2588\u521d\u59cb\u5316\u6267\u884c\u5668\u670d\u52a1\u2588\n    initEmbedServer(address, ip, port, appname, accessToken);\n}<\/code><\/pre>\n\n\n\n<p>\u4e3b\u8981\u5173\u6ce8\u4e0a\u9762\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>initAdminBizList(adminAddresses, accessToken);\/\/ \u2588\u521d\u59cb\u5316admin\u7684\u5ba2\u6237\u7aef\u2588<\/code><\/pre>\n\n\n\n<p>\u548c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>initEmbedServer(address, ip, port, appname, accessToken);\/\/ \u2588\u521d\u59cb\u5316\u6267\u884c\u5668\u670d\u52a1\u2588<\/code><\/pre>\n\n\n\n<p>\u9010\u4e2a\u5206\u6790\u4e0a\u9762\u4e24\u4e2a\u65b9\u6cd5\u3002<\/p>\n\n\n\n<p>initAdminBizList(&#8230;\uff09\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>private void initAdminBizList(String adminAddresses, String accessToken) throws Exception {\n    if (adminAddresses!=null &amp;&amp; adminAddresses.trim().length()&gt;0) {\n        for (String address: adminAddresses.trim().split(\",\")) {\n            if (address!=null &amp;&amp; address.trim().length()&gt;0) {\n\n                AdminBiz adminBiz = new AdminBizClient(address.trim(), accessToken);\n\n                if (adminBizList == null) {\n                    adminBizList = new ArrayList&lt;AdminBiz&gt;();\n                }\n                adminBizList.add(adminBiz);\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u65b9\u6cd5\u662f\u5c06\u4e00\u4e2a\u6216\u591a\u4e2a\u8c03\u5ea6\u4e2d\u5fc3\u5730\u5740\u5c01\u88c5\u6210 AdminBizClient \u96c6\u5408\uff0cAdminBizClient \u6e90\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1548\" height=\"505\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2.png\" alt=\"\" class=\"wp-image-807\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2.png 1548w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-300x98.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-1024x334.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-768x251.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-1536x501.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-1222x399.png 1222w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-2-922x301.png 922w\" sizes=\"(max-width: 1548px) 100vw, 1548px\" \/><\/a><\/figure>\n\n\n\n<p><strong>\u4f5c\u7528<\/strong>\uff1a<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">AdminBizClient \u4e2d\u7684 addressUrl \u662f\u8c03\u5ea6\u4e2d\u5fc3\u7684\u5730\u5740\uff0cregistry\u3001callback\u3001registryRemove \u65b9\u6cd5\u5206\u522b\u8c03\u7528\u8c03\u5ea6\u4e2d\u5fc3\u7684\u76f8\u5173\u65b9\u6cd5\uff0c\u5373\u53ef\u4ee5\u901a\u8fc7 AdminBizClient \u5f80\u8c03\u5ea6\u4e2d\u5fc3\u53d1\u8d77 registry\u3001callback\u3001registryRemove \u8bf7\u6c42\u3002<\/mark><\/p>\n\n\n\n<p><strong>initEmbedServer(&#8230;) \u65b9\u6cd5\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * \u8be5\u65b9\u6cd5\u4e3b\u8981\u505a\u4e86\u5982\u4e0b\u4e8b\u60c5\uff1a\n *\n * 1.\u4f7f\u7528netty\u5f00\u653e\u7aef\u53e3\uff0c\u7b49\u5f85\u670d\u52a1\u7aef\u8c03\u7528\n * 2.\u6ce8\u518c\u5230\u670d\u52a1\u7aef(\u5fc3\u8df330S)\n * 3.\u5411\u670d\u52a1\u7aef\u7533\u8bf7\u5254\u9664\u670d\u52a1\n *\n * @param address\uff08\u6267\u884c\u5668\u5730\u5740,\u5982\u679c\u6307\u5b9a\u4e86\u5c31\u7528\u8be5\u503c,\u5426\u5219\u65b9\u6cd5\u5185\u4f1a\u81ea\u52a8\u83b7\u53d6\u672c\u673a\u7684 IP:port \u4f5c\u4e3a address\uff09\n * @param ip\n * @param port\n * @param appname\n * @param accessToken\n * @throws Exception\n *\/\nprivate void initEmbedServer(String address, String ip, int port, String appname, String accessToken) throws Exception {\n\n    \/\/ fill ip port\n    port = port &gt; 0 ? port : NetUtil.findAvailablePort(9999);\n    ip = (ip != null &amp;&amp; ip.trim().length() &gt; 0) ? ip : IpUtil.getIp();\n\n    \/\/ generate address\n    if (address == null || address.trim().length() == 0) {\n        String ip_port_address = IpUtil.getIpPort(ip, port);   \/\/ registry-address\uff1adefault use address to registry , otherwise use ip:port if address is null\n        address = \"http:\/\/{ip_port}\/\".replace(\"{ip_port}\", ip_port_address);\n    }\n\n    \/\/ start\n    embedServer = new EmbedServer();\n    embedServer.start(address, port, appname, accessToken);\n}<\/code><\/pre>\n\n\n\n<p><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">initEmbedServer(\u2026) \u65b9\u6cd5\u7684\u4f5c\u7528\u5176\u6ce8\u91ca\u4e0a\u5df2\u7ecf\u8bf4\u7684\u5f88\u6e05\u695a\u4e86\uff0c\u5b83\u4f1a\u627e\u5230\u672c\u5730\uff08\u6267\u884c\u5668\uff09\u7684 IP \u5730\u5740\u548c\u4e00\u4e2a\u53ef\u7528\u7aef\u53e3\uff08\u9ed8\u8ba4\u662f9999\uff09\uff0c\u7136\u540e\u7528\u8fd9\u4e2a IP:port \u548c\u8c03\u5ea6\u4e2d\u5fc3\u8fdb\u884c\u901a\u4fe1\uff0c\u540c\u65f6\u8fd9\u4e2a  IP:port \u4e5f\u4f1a\u8bb0\u5f55\u5728 xxl_job_registry \u8868\u91cc\u9762\u3002<\/mark>\u6211\u4eec\u770b\u770b embedServer.start(address, port, appname, accessToken); \u7684\u5177\u4f53\u5b9e\u73b0\uff0c\u8fd9\u4e2a\u65b9\u6cd5\u5728 EmbedServer \u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public void start(final String address, final int port, final String appname, final String accessToken) {\n        executorBiz = new ExecutorBizImpl();\/\/\u301001\u3011\n        thread = new Thread(new Runnable() {\n\n            @Override\n            public void run() {\n\n                \/\/ param\n                EventLoopGroup bossGroup = new NioEventLoopGroup();\n                EventLoopGroup workerGroup = new NioEventLoopGroup();\n                ThreadPoolExecutor bizThreadPool = new ThreadPoolExecutor(\n                        0,\n                        200,\n                        60L,\n                        TimeUnit.SECONDS,\n                        new LinkedBlockingQueue&lt;Runnable&gt;(2000),\n                        new ThreadFactory() {\n                            @Override\n                            public Thread newThread(Runnable r) {\n                                return new Thread(r, \"xxl-rpc, EmbedServer bizThreadPool-\" + r.hashCode());\n                            }\n                        },\n                        new RejectedExecutionHandler() {\n                            @Override\n                            public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {\n                                throw new RuntimeException(\"xxl-job, EmbedServer bizThreadPool is EXHAUSTED!\");\n                            }\n                        });\n\n\n                try {\n                    \/\/ start server\n                    ServerBootstrap bootstrap = new ServerBootstrap();\n                    bootstrap.group(bossGroup, workerGroup)\n                            .channel(NioServerSocketChannel.class)\n                            .childHandler(new ChannelInitializer&lt;SocketChannel&gt;() {\n                                @Override\n                                public void initChannel(SocketChannel channel) throws Exception {\n                                    channel.pipeline()\n                                            .addLast(new IdleStateHandler(0, 0, 30 * 3, TimeUnit.SECONDS))  \/\/ beat 3N, close if idle\n                                            .addLast(new HttpServerCodec())\n                                            .addLast(new HttpObjectAggregator(5 * 1024 * 1024))  \/\/ merge request &amp; reponse to FULL\n                                            .addLast(new EmbedHttpServerHandler(executorBiz, accessToken, bizThreadPool));\/\/\u301002\u3011\n                                }\n                            })\n                            .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n                    \/\/ bind\n                    ChannelFuture future = bootstrap.bind(port).sync();\n\n                    logger.info(\"&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; xxl-job remoting server start success, nettype = {}, port = {}\", EmbedServer.class, port);\n\n                    \/\/ start registry\u3010\u5c06\u6267\u884c\u5668appname\u548c\u5176\u5730\u5740address\u6ce8\u518c\u5230\u8c03\u5ea6\u4e2d\u5fc3\u4e0a\u3011\n                    startRegistry(appname, address);\/\/\u301003\u3011\n\n                    \/\/ wait util stop\n                    future.channel().closeFuture().sync();\n\n                } catch (InterruptedException e) {\n                    if (e instanceof InterruptedException) {\n                        logger.info(\"&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; xxl-job remoting server stop.\");\n                    } else {\n                        logger.error(\"&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; xxl-job remoting server error.\", e);\n                    }\n                } finally {\n                    \/\/ stop\n                    try {\n                        workerGroup.shutdownGracefully();\n                        bossGroup.shutdownGracefully();\n                    } catch (Exception e) {\n                        logger.error(e.getMessage(), e);\n                    }\n                }\n\n            }\n\n        });\n        thread.setDaemon(true);\t\/\/ daemon, service jvm, user thread leave &gt;&gt;&gt; daemon leave &gt;&gt;&gt; jvm leave\n        thread.start();\n    }<\/code><\/pre>\n\n\n\n<p>\u4e3b\u8981\u5173\u6ce8\u4e0a\u9762\u8fd9\u4e2a\u65b9\u6cd5\u91cc\u4e09\u4e2a\u5730\u65b9\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<p>01 \u5904\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>executorBiz = new ExecutorBizImpl();<\/code><\/pre>\n\n\n\n<p> \u5173\u4e8e ExecutorBizImpl \u7c7b\u7684\u5206\u6790\u89c1\uff1a<a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/26\/xxl-job2\/\">xxl-job\u6e90\u7801\u4e3b\u8981\u7c7b &#8211; \u7801\u5148\u751f\u7684\u535a\u5ba2 (codermr.com)<\/a><\/p>\n\n\n\n<p>02 \u5904\uff1a<\/p>\n\n\n\n<p>\u4e3b\u8981\u662f\u521b\u5efa\u4e86\u4e00\u4e2a EmbedHttpServerHandler \u5bf9\u8c61\uff0c\u5165\u53c2\u662f executorBiz\uff08ExecutorBizImpl\uff09, accessToken, bizThreadPool \uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>new EmbedHttpServerHandler(executorBiz, accessToken, bizThreadPool)<\/code><\/pre>\n\n\n\n<p>EmbedHttpServerHandler \u662f EmbedServer \u7684\u4e00\u4e2a\u9759\u6001\u5185\u90e8\u7c7b\uff0c\u7531\u4e8e xxl-job \u4f7f\u7528\u7684 netty \u7248\u672c\u4e3a 4.x\uff0c\u6240\u4ee5\u5b83\u9700\u8981\u5b9e\u73b0\u7684\u62bd\u8c61\u65b9\u6cd5\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>protected void channelRead0(final ChannelHandlerContext ctx, FullHttpRequest msg) throws Exception {\n}<\/code><\/pre>\n\n\n\n<p>\u5728\u91cd\u5199\u7684\u8be5\u65b9\u6cd5\u91cc\u9762\u4e3b\u8981\u4ee3\u7801\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bizThreadPool.execute(new Runnable() {\n    @Override\n    public void run() {\n        \/\/ do invoke\n        Object responseObj = process(httpMethod, uri, requestData, accessTokenReq);\n\n        \/\/ to json\n        String responseJson = GsonTool.toJson(responseObj);\n\n        \/\/ write response\n        writeResponse(ctx, keepAlive, responseJson);\n    }\n});<\/code><\/pre>\n\n\n\n<p>\u4e3b\u8981\u662f\u4e0a\u9762\u7684 process \u65b9\u6cd5\uff0c\u4e3b\u8981\u4f5c\u7528\u662f\u6839\u636e\u4e0d\u540c\u7684 uri \u8c03\u7528 executorBiz\uff08\u5b9e\u73b0\u7c7b\u662f ExecutorBizImpl \uff09 \u7684\u4e0d\u540c\u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (\"\/beat\".equals(uri)) {\n    return executorBiz.beat();\n} else if (\"\/idleBeat\".equals(uri)) {\n    IdleBeatParam idleBeatParam = GsonTool.fromJson(requestData, IdleBeatParam.class);\n    return executorBiz.idleBeat(idleBeatParam);\n} else if (\"\/run\".equals(uri)) {\n    TriggerParam triggerParam = GsonTool.fromJson(requestData, TriggerParam.class);\n    return executorBiz.run(triggerParam);\n} else if (\"\/kill\".equals(uri)) {\n    KillParam killParam = GsonTool.fromJson(requestData, KillParam.class);\n    return executorBiz.kill(killParam);\n} else if (\"\/log\".equals(uri)) {\n    LogParam logParam = GsonTool.fromJson(requestData, LogParam.class);\n    return executorBiz.log(logParam);\n} else {\n    return new ReturnT&lt;String&gt;(ReturnT.FAIL_CODE, \"invalid request, uri-mapping(\"+ uri +\") not found.\");\n}<\/code><\/pre>\n\n\n\n<p>ExecutorBizImpl \u662f\u5728\u6267\u884c\u5668\u4e2d\u88ab\u4f7f\u7528\u7684\uff0c\u4e0a\u9762\u4f7f\u7528\u4e86 Netty \u548c\u8c03\u5ea6\u4e2d\u5fc3\u8fdb\u884c\u901a\u4fe1\uff0c\u5728\u63a5\u53d7\u5230\u8c03\u5ea6\u4e2d\u5fc3\u53d1\u9001\u8fc7\u6765\u7684\u7f51\u7edc\u8bf7\u6c42\u540e\uff08\u8c03\u5ea6\u4e2d\u5fc3\u4f7f\u7528 ExecutorBizClient \u53d1\u9001\uff09\uff0c\u521b\u5efa\u4e86\u4e00\u4e2a EmbedHttpServerHandler \u5904\u7406\u8be5\u7f51\u7edc\u8bf7\u6c42\uff0c\u800c EmbedHttpServerHandler \u4e2d\u5c31\u662f\u7528 ExecutorBizImpl  \u6765\u5904\u7406\u7f51\u7edc\u8bf7\u6c42\u7684\u3002\u5173\u4e8e ExecutorBizImpl \u7c7b\u7684\u5206\u6790\u89c1\uff1a<a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/26\/xxl-job2\/\">xxl-job\u6e90\u7801\u4e3b\u8981\u7c7b &#8211; \u7801\u5148\u751f\u7684\u535a\u5ba2 (codermr.com)<\/a><\/p>\n\n\n\n<p>03 \u5904\uff1a<\/p>\n\n\n\n<p>startRegistry(appname, address); \u65b9\u6cd5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u3010\u5c06\u6267\u884c\u5668\u6ce8\u518c\u5230 xxl-job \u7684 admin \u4e0a\u9762\u3011\npublic void startRegistry(final String appname, final String address) {\n    \/\/ start registry\n    ExecutorRegistryThread.getInstance().start(appname, address);\n}<\/code><\/pre>\n\n\n\n<p>\u5177\u4f53\u5b9e\u73b0\u5728 ExecutorRegistryThread \u4e2d\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"2877\" height=\"1448\" src=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7.png\" alt=\"\" class=\"wp-image-887\" srcset=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7.png 2877w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-300x151.png 300w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-1024x515.png 1024w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-768x387.png 768w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-1536x773.png 1536w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-2048x1031.png 2048w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-1222x615.png 1222w, http:\/\/codermr.com\/wp-content\/uploads\/2023\/03\/image-7-922x464.png 922w\" sizes=\"(max-width: 2877px) 100vw, 2877px\" \/><\/a><\/figure>\n\n\n\n<p>\u4e0a\u56fe 46 \u884c\u7684 adminBiz\uff08AdminBizClient\uff09 \u5c31\u662f\u4e0a\u9762\u8bb2\u7684 initAdminBizList(\u2026\uff09\u65b9\u6cd5\u91cc\u9762\u751f\u6210\u7684\uff0c\u6709\u51e0\u4e2a\u8c03\u5ea6\u4e2d\u5fc3\uff0c\u5c31\u4f1a\u6709\u51e0\u4e2a adminBiz \u5b9e\u4f8b\uff0c\u6267\u884c\u5668\u4f1a\u5f80\u8fd9\u51e0\u4e2a\u8c03\u5ea6\u4e2d\u5fc3\u4e0a\u5206\u522b\u6ce8\u518c\u81ea\u5df1\u3002\u5f80\u8c03\u5ea6\u4e2d\u5fc3\u4e0a\u6ce8\u518c\u5b8c\u4e4b\u540e\u4f1a\u6709\u4e00\u4e2a 30s \u7684\u4f11\u7720\u65f6\u95f4\uff08\u4e0a\u56fe\u7b2c 70 \u884c\u4ee3\u7801\uff09\uff0c\u5373\u6267\u884c\u5668\u6bcf\u9694 30s \u5f80\u8c03\u5ea6\u4e2d\u5fc3\u6ce8\u518c\u4e00\u6b21\u81ea\u5df1\u3002\u8fd9\u4e2a\u65f6\u95f4\u95f4\u9694\u5728\u8fd9\u91cc\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public class RegistryConfig {\n    public static final int BEAT_TIMEOUT = 30;\n    public static final int DEAD_TIMEOUT = BEAT_TIMEOUT * 3;\n\n    public enum RegistType{ EXECUTOR, ADMIN }\n}<\/code><\/pre>\n\n\n\n<p>\u6240\u4ee5\uff0c<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">embedServer.start(address, port, appname, accessToken); \u65b9\u6cd5\u7684\u4f5c\u7528\u662f<\/mark>\uff1a<\/p>\n\n\n\n<ul>\n<li>\u4f7f\u7528 Netty \u548c\u8c03\u5ea6\u4e2d\u5fc3\u4fdd\u6301\u5fc3\u8df3\u548c\u901a\u4fe1\uff0c\u8c03\u5ea6\u4e2d\u5fc3\u4f1a\u901a\u8fc7 <s>Netty<\/s>  Http \u8bf7\u6c42\u68c0\u6d4b\u6267\u884c\u5668\u662f\u5426\u53ef\u7528\uff0c\u5e76\u901a\u8fc7 <s>Netty<\/s> Http \u8bf7\u6c42\u901a\u77e5\u6267\u884c\u5668\u6267\u884c\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\u3002<\/li>\n\n\n\n<li>\u5468\u671f\u6027\u7684\uff08\u6bcf\u9694 30s\uff09\u5f80\u8c03\u5ea6\u4e2d\u5fc3\u6ce8\u518c\u81ea\u5df1\uff08\u4f7f\u7528 Http \u8bf7\u6c42\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">\u5c0f\u7ed3\uff1a<\/h6>\n\n\n\n<ul>\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong>\u6267\u884c\u5668\u901a\u8fc7 Netty \u548c\u8c03\u5ea6\u4e2d\u5fc3\u4fdd\u6301\u901a\u4fe1\u7684\u63a5\u53e3\u53ea\u6709\u8fd9\u51e0\u4e2a\uff1a<\/strong><\/mark><\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>try {\n    if (\"\/beat\".equals(uri)) {\n        return executorBiz.beat();\n    } else if (\"\/idleBeat\".equals(uri)) {\n        IdleBeatParam idleBeatParam = GsonTool.fromJson(requestData, IdleBeatParam.class);\n        return executorBiz.idleBeat(idleBeatParam);\n    } else if (\"\/run\".equals(uri)) {\n        TriggerParam triggerParam = GsonTool.fromJson(requestData, TriggerParam.class);\n        return executorBiz.run(triggerParam);\n    } else if (\"\/kill\".equals(uri)) {\n        KillParam killParam = GsonTool.fromJson(requestData, KillParam.class);\n        return executorBiz.kill(killParam);\n    } else if (\"\/log\".equals(uri)) {\n        LogParam logParam = GsonTool.fromJson(requestData, LogParam.class);\n        return executorBiz.log(logParam);\n    } else {\n        return new ReturnT&lt;String>(ReturnT.FAIL_CODE, \"invalid request, uri-mapping(\"+ uri +\") not found.\");\n    }\n} catch (Exception e) {\n    logger.error(e.getMessage(), e);\n    return new ReturnT&lt;String>(ReturnT.FAIL_CODE, \"request error:\" + ThrowableUtil.toString(e));\n}<\/code><\/pre>\n\n\n\n<ul>\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong>\u6267\u884c\u5668\u6bcf\u9694 30s \u5f80\u8c03\u5ea6\u4e2d\u5fc3\u6ce8\u518c\u81ea\u5df1\uff0c\u662f\u5728 ExecutorRegistryThread  \u4e2d\uff0c\u662f\u901a\u8fc7 Http \u8bf7\u6c42\u8fdb\u884c\u7684\u3002<\/strong><\/mark><\/li>\n\n\n\n<li><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">\u8c03\u5ea6\u4e2d\u5fc3\u901a\u77e5\u6267\u884c\u5668\u6267\u884c\u5b9a\u65f6\u4efb\u52a1\uff0c\u662f\u5728 com.xxl.job.admin.core.trigger.XxlJobTrigger#runExecutor \u8fd9\u91cc\u662f\u901a\u8fc7 Http \u8bf7\u6c42\u7684\u65b9\u5f0f\u3002<\/mark><\/strong>\u800c\u5177\u4f53\u8c03\u5ea6\u4e2d\u5fc3\u662f\u600e\u4e48\u901a\u77e5\u6267\u884c\u5668\u6267\u884c\u5b9a\u65f6\u4efb\u52a1\u7684\u89c1\uff1a<a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/27\/xxl-job3\/\">xxl-job\u539f\u7406\u8bb2\u89e3\uff08\u4e09\uff09\uff1a\u8c03\u5ea6\u4e2d\u5fc3 &#8211; \u7801\u5148\u751f\u7684\u535a\u5ba2 (codermr.com)<\/a><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h6 class=\"wp-block-heading\">\u8c03\u5ea6\u4e2d\u5fc3\u901a\u77e5\u6267\u884c\u5668\u6267\u884c\u4efb\u52a1<\/h6>\n\n\n\n<ol>\n<li>\u8c03\u5ea6\u4e2d\u5fc3\u5411\u5ba2\u6237\u7aef\u53d1\u8d77 post \u8bf7\u6c42<\/li>\n\n\n\n<li>client \u901a\u8fc7\u5185\u5d4c\u670d\u52a1 netty \u63a5\u6536\uff0c\u5f02\u6b65\u7ebf\u7a0b\u5904\u7406<\/li>\n\n\n\n<li>\u627e\u5230 job \u7ed1\u5b9a\u7684\u7ebf\u7a0b\uff0c\u5c06\u4efb\u52a1\u4e22\u5230\u963b\u585e\u961f\u5217\u4e2d\u3002\u7136\u540e\u8fd4\u56de\u7ed3\u679c\u7ed9\u8c03\u5ea6\u4e2d\u5fc3\u3002<\/li>\n\n\n\n<li>\u8c03\u5ea6\u4e2d\u5fc3\u66f4\u6539\u4efb\u52a1\u72b6\u6001\u3002<\/li>\n\n\n\n<li>\u5ba2\u6237\u7aef\u6267\u884c\u4efb\u52a1\u540e\uff0c\u5c06\u6267\u884c\u7ed3\u679c\u4e22\u5230\u56de\u8c03\u7ebf\u7a0b\u7684\u963b\u585e\u961f\u5217\u5904\u7406\u3002<\/li>\n\n\n\n<li>\u56de\u8c03\u7ebf\u7a0b\u901a\u8fc7 post \u8bf7\u6c42\u8bbf\u95ee\u8c03\u5ea6\u4e2d\u5fc3\uff0c\u8c03\u5ea6\u4e2d\u5fc3\u66f4\u6539 job \u6700\u7ec8\u7ed3\u679c\u3002<\/li>\n\n\n\n<li>\u5018\u82e5\u8d85\u8fc7 10 \u5206\u949f\u8c03\u5ea6\u4e2d\u5fc3\u6ca1\u6536\u5230\u56de\u8c03\u7ebf\u7a0b\u7684\u8bf7\u6c42\uff0c\u5219\u8bbe\u7f6e job \u6700\u7ec8\u7ed3\u679c\u5931\u8d25\u3002<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h6 class=\"wp-block-heading\">&#8220;\u8c03\u5ea6\u6210\u529f&#8221;\u548c&#8221;\u6267\u884c\u6210\u529f&#8221;\u7684\u542b\u4e49\u53ca\u533a\u522b\uff1f<\/h6>\n\n\n\n<p>\u5728 xxl-job \u7684\u8c03\u5ea6\u65e5\u5fd7\u4e2d\uff0c\u6709\u4e00\u4e2a&#8221;\u8c03\u5ea6\u7ed3\u679c&#8221;\u548c&#8221;\u6267\u884c\u7ed3\u679c&#8221;\u7684\u5b57\u6bb5\uff0c\u90a3\u4e48\u8fd9\u4e24\u8005\u662f\u4ec0\u4e48\u542b\u4e49\u3001\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f<\/p>\n\n\n\n<ul>\n<li>&#8220;\u8c03\u5ea6\u7ed3\u679c&#8221;\uff0c\u662f\u8c03\u5ea6\u4e2d\u5fc3\u8c03\u5ea6\u67d0\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\uff0c\u662f\u5426\u8c03\u5ea6\u6210\u529f\u4e86\uff0c\u8fd9\u4e2a\u72b6\u6001\u662f\u8c03\u5ea6\u4e2d\u5fc3\u7ef4\u62a4\u7684\u3002<\/li>\n\n\n\n<li>&#8220;\u6267\u884c\u7ed3\u679c&#8221;\uff0c\u662f\u6267\u884c\u5668\u6267\u884c\u5b9a\u65f6\u4efb\u52a1\u5177\u4f53\u662f\u6210\u529f\u8fd8\u662f\u5931\u8d25\u4e86\uff0c\u6267\u884c\u5668\u4f1a\u56de\u8c03\u8c03\u5ea6\u4e2d\u5fc3\u7684 callback \u65b9\u6cd5\uff0c\u5177\u4f53\u6765\u8bf4\u662f\u6267\u884c\u5668\u4e2d\u7684 triggerCallbackThread \u7ebf\u7a0b\u4f1a\u5c06\u5b9a\u65f6\u4efb\u52a1\u6267\u884c\u7684\u7ed3\u679c\uff0c\u901a\u8fc7\u56de\u8c03\u8c03\u5ea6\u4e2d\u5fc3\u7684 callback \u65b9\u6cd5\u5c06\u6267\u884c\u7ed3\u679c\u4fdd\u5b58\u5728\u8c03\u5ea6\u4e2d\u5fc3\u7684\u6570\u636e\u5e93\u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u540e\u7eed\u5185\u5bb9\u8bf7\u8bbf\u95ee\uff1a<\/p>\n\n\n\n<p><a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/26\/xxl-job2\/\">xxl-job\u539f\u7406\u8bb2\u89e3\uff08\u4e8c\uff09\uff1a\u4e3b\u8981\u7c7b &#8211; \u7801\u5148\u751f\u7684\u535a\u5ba2 (codermr.com)<\/a><\/p>\n\n\n\n<p><a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/27\/xxl-job3\/\"><a href=\"http:\/\/codermr.com\/index.php\/2023\/03\/27\/xxl-job3\/\">xxl-job\u539f\u7406\u8bb2\u89e3\uff08\u4e09\uff09\uff1a\u8c03\u5ea6\u4e2d\u5fc3 &#8211; \u7801\u5148\u751f\u7684\u535a\u5ba2 (codermr.com)<\/a><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6765\u60f3\u5206\u4e09\u7bc7\u6587\u7ae0\u6765\u8be6\u7ec6\u8bb2\u89e3\u548c\u5206\u6790 xxl-job \uff0c\u4f46\u6700\u8fd1\u8f83\u5fd9\uff0c\u7efc\u5408\u5199\u5728\u4e00\u7bc7\u91cc\u9762\u4e86\uff0c\u6240\u4ee5\u672c\u6587\u4e0d\u518d\u8bb2\u8ff0\u5b9a\u65f6\u4efb\u52a1\u3001&#8230;<\/p>\n","protected":false},"author":1,"featured_media":729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[51],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6765\u60f3\u5206\u4e09\u7bc7\u6587\u7ae0\u6765\u8be6\u7ec6\u8bb2\u89e3\u548c\u5206\u6790 xxl-job \uff0c\u4f46\u6700\u8fd1\u8f83\u5fd9\uff0c\u7efc\u5408\u5199\u5728\u4e00\u7bc7\u91cc\u9762\u4e86\uff0c\u6240\u4ee5\u672c\u6587\u4e0d\u518d\u8bb2\u8ff0\u5b9a\u65f6\u4efb\u52a1\u3001...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7801\u5148\u751f\u7684\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-26T16:17:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-27T12:32:43+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/xxl1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"221\" \/>\n\t<meta property=\"og:image:height\" content=\"218\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u7801\u5148\u751f\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/mrcode2021\" \/>\n<meta name=\"twitter:site\" content=\"@mrcode2021\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u7801\u5148\u751f\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\"},\"author\":{\"name\":\"\u7801\u5148\u751f\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"headline\":\"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09\",\"datePublished\":\"2023-02-26T16:17:58+00:00\",\"dateModified\":\"2023-03-27T12:32:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\"},\"wordCount\":193,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"keywords\":[\"xxl-job\"],\"articleSection\":[\"JAVA\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\",\"url\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\",\"name\":\"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"http:\/\/codermr.com\/#website\"},\"datePublished\":\"2023-02-26T16:17:58+00:00\",\"dateModified\":\"2023-03-27T12:32:43+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/codermr.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/codermr.com\/#website\",\"url\":\"http:\/\/codermr.com\/\",\"name\":\"\u7801\u5148\u751f\u7684\u535a\u5ba2\",\"description\":\"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP\",\"publisher\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/codermr.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf\",\"name\":\"\u7801\u5148\u751f\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"contentUrl\":\"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg\",\"width\":400,\"height\":400,\"caption\":\"\u7801\u5148\u751f\"},\"logo\":{\"@id\":\"http:\/\/codermr.com\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/codermr.com\",\"https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021\"],\"url\":\"http:\/\/codermr.com\/index.php\/author\/coderma\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/","og_locale":"zh_CN","og_type":"article","og_title":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2","og_description":"\u672c\u6765\u60f3\u5206\u4e09\u7bc7\u6587\u7ae0\u6765\u8be6\u7ec6\u8bb2\u89e3\u548c\u5206\u6790 xxl-job \uff0c\u4f46\u6700\u8fd1\u8f83\u5fd9\uff0c\u7efc\u5408\u5199\u5728\u4e00\u7bc7\u91cc\u9762\u4e86\uff0c\u6240\u4ee5\u672c\u6587\u4e0d\u518d\u8bb2\u8ff0\u5b9a\u65f6\u4efb\u52a1\u3001...","og_url":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/","og_site_name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","article_published_time":"2023-02-26T16:17:58+00:00","article_modified_time":"2023-03-27T12:32:43+00:00","og_image":[{"width":221,"height":218,"url":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/xxl1.jpg","type":"image\/jpeg"}],"author":"\u7801\u5148\u751f","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/mrcode2021","twitter_site":"@mrcode2021","twitter_misc":{"\u4f5c\u8005":"\u7801\u5148\u751f","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#article","isPartOf":{"@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/"},"author":{"name":"\u7801\u5148\u751f","@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"headline":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09","datePublished":"2023-02-26T16:17:58+00:00","dateModified":"2023-03-27T12:32:43+00:00","mainEntityOfPage":{"@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/"},"wordCount":193,"commentCount":0,"publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"keywords":["xxl-job"],"articleSection":["JAVA"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/","url":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/","name":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09 - \u7801\u5148\u751f\u7684\u535a\u5ba2","isPartOf":{"@id":"http:\/\/codermr.com\/#website"},"datePublished":"2023-02-26T16:17:58+00:00","dateModified":"2023-03-27T12:32:43+00:00","breadcrumb":{"@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/codermr.com\/index.php\/2023\/02\/27\/xxl-job1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/codermr.com\/"},{"@type":"ListItem","position":2,"name":"xxl-job \u539f\u7406\u8bb2\u89e3\uff08\u4e00\uff09"}]},{"@type":"WebSite","@id":"http:\/\/codermr.com\/#website","url":"http:\/\/codermr.com\/","name":"\u7801\u5148\u751f\u7684\u535a\u5ba2","description":"\u6b22 \u8fce \u4e0b \u8f7d \u6211 \u5f00 \u53d1 \u7684 \u5404 \u7aef \u8f6f \u4ef6 \u548c APP","publisher":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/codermr.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/codermr.com\/#\/schema\/person\/39016e15c79e4f02d1ed3a64688619bf","name":"\u7801\u5148\u751f","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/","url":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","contentUrl":"http:\/\/codermr.com\/wp-content\/uploads\/2023\/02\/wukong.jpg","width":400,"height":400,"caption":"\u7801\u5148\u751f"},"logo":{"@id":"http:\/\/codermr.com\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/codermr.com","https:\/\/twitter.com\/https:\/\/twitter.com\/mrcode2021"],"url":"http:\/\/codermr.com\/index.php\/author\/coderma\/"}]}},"_links":{"self":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/150"}],"collection":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":36,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"predecessor-version":[{"id":924,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/posts\/150\/revisions\/924"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media\/729"}],"wp:attachment":[{"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/codermr.com\/index.php\/wp-json\/wp\/v2\/tags?post=150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}