|
|
@@ -1,12 +1,16 @@
|
|
|
package com.mrxu.framework.stater.xxl.config;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
|
|
import org.springframework.cloud.commons.util.InetUtils;
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
|
|
|
/**
|
|
|
* 功能概要:[] <br>
|
|
|
@@ -16,6 +20,7 @@ import org.springframework.context.annotation.Configuration;
|
|
|
*/
|
|
|
@Configuration
|
|
|
@ConditionalOnProperty({"xxl.job.admin.addresses"})
|
|
|
+@Slf4j
|
|
|
public class XxlJobConfig {
|
|
|
@Value("${xxl.job.admin.addresses}")
|
|
|
private String adminAddresses;
|
|
|
@@ -37,7 +42,7 @@ public class XxlJobConfig {
|
|
|
|
|
|
@Bean
|
|
|
public XxlJobSpringExecutor xxlJobExecutor(InetUtils inetUtils) {
|
|
|
- System.out.println("xxl-job-executor-spring-boot-starter config init.");
|
|
|
+ log.info("xxl-job-executor-spring-boot-starter config init.");
|
|
|
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
|
|
xxlJobSpringExecutor.setAdminAddresses(this.adminAddresses);
|
|
|
xxlJobSpringExecutor.setAppname(this.appname);
|
|
|
@@ -50,7 +55,7 @@ public class XxlJobConfig {
|
|
|
} else {
|
|
|
xxlJobSpringExecutor.setIp(this.ip);
|
|
|
}
|
|
|
-
|
|
|
+ log.info("xxl-job-executor,参数:{}" + JSONUtil.toJsonStr(xxlJobSpringExecutor));
|
|
|
return xxlJobSpringExecutor;
|
|
|
}
|
|
|
}
|