feat(xxl-job): 添加执行器启用配置并优化属性设置

- 在 FrameLessXxlJobConfig 中添加执行器启用配置选项
- 在 SpringBoot 配置中增加 enabled 属性注入
- 调整 XxlJobSpringExecutor 属性设置顺序以提高可读性
- 更新 application.properties 和 xxl-job-executor.properties 配置文件注释及默认值
- 修复排除包配置属性名称拼写错误
- 在 AI 示例项目中同步支持 excludedPackage 配置
3.3.1-release
xuxueli 1 month ago
parent 2211110c33
commit c4831bc4f4

@ -37,6 +37,7 @@ public class FrameLessXxlJobConfig {
xxlJobExecutor.setAdminAddresses(xxlJobProp.getProperty("xxl.job.admin.addresses"));
xxlJobExecutor.setAccessToken(xxlJobProp.getProperty("xxl.job.admin.accessToken"));
xxlJobExecutor.setTimeout(Integer.valueOf(xxlJobProp.getProperty("xxl.job.admin.timeout")));
xxlJobExecutor.setEnabled(Boolean.valueOf(xxlJobProp.getProperty("xxl.job.executor.enabled")));
xxlJobExecutor.setAppname(xxlJobProp.getProperty("xxl.job.executor.appname"));
xxlJobExecutor.setAddress(xxlJobProp.getProperty("xxl.job.executor.address"));
xxlJobExecutor.setIp(xxlJobProp.getProperty("xxl.job.executor.ip"));

@ -1,10 +1,12 @@
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
### xxl-job access-token
### xxl-job access token
xxl.job.admin.accessToken=default_token
### xxl-job timeout by second, default 3s
xxl.job.admin.timeout=3
### xxl-job executor enable, default true
xxl.job.executor.enabled=true
### xxl-job executor appname
xxl.job.executor.appname=xxl-job-executor-sample
### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null

@ -46,6 +46,9 @@ public class XxlJobConfig {
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Value("${xxl.job.executor.excludedpackage}")
private String excludedPackage;
@Bean
public XxlJobSpringExecutor xxlJobExecutor() {
@ -61,6 +64,7 @@ public class XxlJobConfig {
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
xxlJobSpringExecutor.setExcludedPackage(excludedPackage);
return xxlJobSpringExecutor;
}

@ -12,7 +12,7 @@ logging.config=classpath:logback.xml
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
### xxl-job, access token
### xxl-job access token
xxl.job.admin.accessToken=default_token
### xxl-job timeout by second, default 3s
xxl.job.admin.timeout=3
@ -30,6 +30,8 @@ xxl.job.executor.port=9997
xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler
### xxl-job executor log-retention-days
xxl.job.executor.logretentiondays=30
### xxl-job executor excluded package, will skip scan job. such as "org.package01" or "org.package01,org.package02"
xxl.job.executor.excludedpackage=
### ollama

@ -25,6 +25,9 @@ public class XxlJobConfig {
@Value("${xxl.job.admin.timeout}")
private int timeout;
@Value("${xxl.job.executor.enabled}")
private Boolean enabled;
@Value("${xxl.job.executor.appname}")
private String appname;
@ -52,12 +55,13 @@ public class XxlJobConfig {
logger.info(">>>>>>>>>>> xxl-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setTimeout(timeout);
xxlJobSpringExecutor.setEnabled(enabled);
xxlJobSpringExecutor.setAppname(appname);
xxlJobSpringExecutor.setAddress(address);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setTimeout(timeout);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
xxlJobSpringExecutor.setExcludedPackage(excludedPackage);

@ -9,11 +9,13 @@ logging.config=classpath:logback.xml
### xxl-job admin address list, such as "http://address" or "http://address01,http://address02"
xxl.job.admin.addresses=http://127.0.0.1:8080/xxl-job-admin
### xxl-job, access token
### xxl-job access token
xxl.job.admin.accessToken=default_token
### xxl-job timeout by second, default 3s
xxl.job.admin.timeout=3
### xxl-job executor enable, default true
xxl.job.executor.enabled=true
### xxl-job executor appname
xxl.job.executor.appname=xxl-job-executor-sample
### xxl-job executor registry-address: default use address to registry , otherwise use ip:port if address is null
@ -25,5 +27,5 @@ xxl.job.executor.port=9999
xxl.job.executor.logpath=/data/applogs/xxl-job/jobhandler
### xxl-job executor log-retention-days
xxl.job.executor.logretentiondays=30
### xxl-job executor excluded package, will skip scan job. such as "org.xxx01" or "org.xxx01,org.xxx02"
xxl.job.executor.excludedpackage=org.springframework,spring
### xxl-job executor excluded package, will skip scan job. such as "org.package01" or "org.package01,org.package02"
xxl.job.executor.excludedpackage=

Loading…
Cancel
Save