feat: 系统模块删除xxl-job
This commit is contained in:
@@ -69,11 +69,6 @@
|
|||||||
<artifactId>schisandra-cloud-storage-system-common</artifactId>
|
<artifactId>schisandra-cloud-storage-system-common</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.xuxueli</groupId>
|
|
||||||
<artifactId>xxl-job-core</artifactId>
|
|
||||||
<version>2.4.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
|
@@ -1,78 +0,0 @@
|
|||||||
package com.schisandra.system.domain.config;
|
|
||||||
|
|
||||||
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* xxl-job config
|
|
||||||
*
|
|
||||||
* @author xuxueli 2017-04-28
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class XxlJobConfig {
|
|
||||||
private Logger logger = LoggerFactory.getLogger(XxlJobConfig.class);
|
|
||||||
|
|
||||||
@Value("${xxl.job.admin.addresses}")
|
|
||||||
private String adminAddresses;
|
|
||||||
|
|
||||||
@Value("${xxl.job.accessToken}")
|
|
||||||
private String accessToken;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.appname}")
|
|
||||||
private String appname;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.address}")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.ip}")
|
|
||||||
private String ip;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.port}")
|
|
||||||
private int port;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.logpath}")
|
|
||||||
private String logPath;
|
|
||||||
|
|
||||||
@Value("${xxl.job.executor.logretentiondays}")
|
|
||||||
private int logRetentionDays;
|
|
||||||
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public XxlJobSpringExecutor xxlJobExecutor() {
|
|
||||||
logger.info(">>>>>>>>>>> xxl-job config init.");
|
|
||||||
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
|
|
||||||
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
|
|
||||||
xxlJobSpringExecutor.setAppname(appname);
|
|
||||||
xxlJobSpringExecutor.setAddress(address);
|
|
||||||
xxlJobSpringExecutor.setIp(ip);
|
|
||||||
xxlJobSpringExecutor.setPort(port);
|
|
||||||
xxlJobSpringExecutor.setAccessToken(accessToken);
|
|
||||||
xxlJobSpringExecutor.setLogPath(logPath);
|
|
||||||
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
|
|
||||||
|
|
||||||
return xxlJobSpringExecutor;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 针对多网卡、容器内部署等情况,可借助 "spring-cloud-commons" 提供的 "InetUtils" 组件灵活定制注册IP;
|
|
||||||
*
|
|
||||||
* 1、引入依赖:
|
|
||||||
* <dependency>
|
|
||||||
* <groupId>org.springframework.cloud</groupId>
|
|
||||||
* <artifactId>spring-cloud-commons</artifactId>
|
|
||||||
* <version>${version}</version>
|
|
||||||
* </dependency>
|
|
||||||
*
|
|
||||||
* 2、配置文件,或者容器启动变量
|
|
||||||
* spring.cloud.inetutils.preferred-networks: 'xxx.xxx.xxx.'
|
|
||||||
*
|
|
||||||
* 3、获取IP
|
|
||||||
* String ip_ = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress();
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@@ -82,17 +82,3 @@ mybatis-flex:
|
|||||||
mapper-locations:
|
mapper-locations:
|
||||||
- "classpath*:/mapper/**/*.xml"
|
- "classpath*:/mapper/**/*.xml"
|
||||||
|
|
||||||
# xxl-job配置
|
|
||||||
xxl:
|
|
||||||
job:
|
|
||||||
admin:
|
|
||||||
addresses: http://1.95.0.111:8088/xxl-job-admin
|
|
||||||
accessToken: default_token
|
|
||||||
executor:
|
|
||||||
appname: schisandra-cloud-storage-system
|
|
||||||
address:
|
|
||||||
ip: 1.95.0.111
|
|
||||||
port: 9998
|
|
||||||
logpath: /data/applogs/xxl-job/jobhandler
|
|
||||||
logretentiondays: 30
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user