提交 e266e5ef 编写于 作者: rushui.chen's avatar rushui.chen

20191106 完善添加接口

上级 39604e69
流水线 #16673 已失败 于阶段
in 0 second
...@@ -150,6 +150,11 @@ ...@@ -150,6 +150,11 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>com.xuxueli</groupId>
<artifactId>xxl-job-core</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
......
package com.pica.cloud.account.account.server.job;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.stereotype.Component;
/**
* Created on 2019/10/29 15:37
* author:crs
* Description:doctor表重复记录处理
*/
@JobHandler(value="AccountRepeatDataJob")
@Component
public class AccountRepeatDataJob extends IJobHandler {
@Override
public ReturnT<String> execute(String s) throws Exception {
return null;
}
}
package com.pica.cloud.account.account.server.starter;
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;
/**
* Created on 2019/11/6 15:39
* author:crs
* Description:配置式job
*/
@Configuration
public class JobExecutorConfiguration {
private Logger logger = LoggerFactory.getLogger(JobExecutorConfiguration.class);
@Value("${xxl.job.admin.addresses}")
private String adminAddresses;
@Value("${xxl.job.executor.appname}")
private String appName;
@Value("${xxl.job.executor.ip}")
private String ip;
@Value("${xxl.job.executor.port}")
private int port;
@Value("${xxl.job.accessToken}")
private String accessToken;
@Value("${xxl.job.executor.logpath}")
private String logPath;
@Value("${xxl.job.executor.logretentiondays}")
private int logRetentionDays;
@Bean(initMethod = "start", destroyMethod = "destroy")
public XxlJobSpringExecutor xxlJobExecutor() {
logger.info("pica-job config init.");
XxlJobSpringExecutor xxlJobSpringExecutor = new XxlJobSpringExecutor();
xxlJobSpringExecutor.setAdminAddresses(adminAddresses);
xxlJobSpringExecutor.setAppName(appName);
xxlJobSpringExecutor.setIp(ip);
xxlJobSpringExecutor.setPort(port);
xxlJobSpringExecutor.setAccessToken(accessToken);
xxlJobSpringExecutor.setLogPath(logPath);
xxlJobSpringExecutor.setLogRetentionDays(logRetentionDays);
return xxlJobSpringExecutor;
}
}
...@@ -51,3 +51,21 @@ spring.rabbitmq.virtual-host=account-register-vhost ...@@ -51,3 +51,21 @@ spring.rabbitmq.virtual-host=account-register-vhost
management.security.enabled=false management.security.enabled=false
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
# Job config begin
# 控制器地址:服务启动自动注册到控制器中
xxl.job.admin.addresses=http://192.168.110.124:7899/job
#执行器命名规则job-exec-<申请Port>
xxl.job.executor.appname=job-exec-<申请Port>
xxl.job.executor.ip=
xxl.job.executor.port=<申请Port>
### xxl-job, access token
xxl.job.accessToken=
### 确保改目录可写/opt/xxl-job-logs/jobhandler
xxl.job.executor.logpath=/opt/xxl-job-logs/jobhandler
### xxl-job log retention days
xxl.job.executor.logretentiondays=-1
...@@ -48,3 +48,21 @@ doubleWritingMode=true ...@@ -48,3 +48,21 @@ doubleWritingMode=true
management.security.enabled=false management.security.enabled=false
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
# Job config begin
# 控制器地址:服务启动自动注册到控制器中
xxl.job.admin.addresses=http://172.19.137.74:7899/job,http://172.19.137.75:7899/job
#执行器命名规则job-exec-<申请Port>
xxl.job.executor.appname=job-exec-<申请Port>
xxl.job.executor.ip=
xxl.job.executor.port=<申请Port>
### xxl-job, access token
xxl.job.accessToken=
### 确保改目录可写/opt/xxl-job-logs/jobhandler
xxl.job.executor.logpath=/opt/xxl-job-logs/jobhandler
### xxl-job log retention days
xxl.job.executor.logretentiondays=-1
...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206 ...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
spring.rabbitmq.username=appuser spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI spring.rabbitmq.password=AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host=account-register-vhost spring.rabbitmq.virtual-host=account-register-vhost
\ No newline at end of file
# Job config begin
# 控制器地址:服务启动自动注册到控制器中
xxl.job.admin.addresses=http://192.168.110.133:7899/job
#执行器命名规则job-exec-<申请Port>
xxl.job.executor.appname=job-exec-<申请Port>
xxl.job.executor.ip=
xxl.job.executor.port=<申请Port>
### xxl-job, access token
xxl.job.accessToken=
### 确保改目录可写/opt/xxl-job-logs/jobhandler
xxl.job.executor.logpath=/opt/xxl-job-logs/jobhandler
### xxl-job log retention days
xxl.job.executor.logretentiondays=-1
...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206 ...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
spring.rabbitmq.username=appuser spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI spring.rabbitmq.password=AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host=account-register-vhost spring.rabbitmq.virtual-host=account-register-vhost
\ No newline at end of file
# Job config begin
# 控制器地址:服务启动自动注册到控制器中
xxl.job.admin.addresses=http://192.168.110.124:7899/job
#执行器命名规则job-exec-<申请Port>
xxl.job.executor.appname=job-exec-<申请Port>
xxl.job.executor.ip=
xxl.job.executor.port=<申请Port>
### xxl-job, access token
xxl.job.accessToken=
### 确保改目录可写/opt/xxl-job-logs/jobhandler
xxl.job.executor.logpath=/opt/xxl-job-logs/jobhandler
### xxl-job log retention days
xxl.job.executor.logretentiondays=-1
...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206 ...@@ -49,4 +49,21 @@ spring.rabbitmq.host=192.168.110.206
spring.rabbitmq.port=5672 spring.rabbitmq.port=5672
spring.rabbitmq.username=appuser spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI spring.rabbitmq.password=AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host=account-register-vhost spring.rabbitmq.virtual-host=account-register-vhost
\ No newline at end of file
# Job config begin
# 控制器地址:服务启动自动注册到控制器中
xxl.job.admin.addresses=http://192.168.110.141:7899/job
#执行器命名规则job-exec-<申请Port>
xxl.job.executor.appname=job-exec-<申请Port>
xxl.job.executor.ip=
xxl.job.executor.port=<申请Port>
### xxl-job, access token
xxl.job.accessToken=
### 确保改目录可写/opt/xxl-job-logs/jobhandler
xxl.job.executor.logpath=/opt/xxl-job-logs/jobhandler
### xxl-job log retention days
xxl.job.executor.logretentiondays=-1
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册