Commit 13d1f3bc authored by tangwei's avatar tangwei

单体模式下,不初始化锁

parent 75904892
...@@ -39,7 +39,6 @@ public class RedissonConfig { ...@@ -39,7 +39,6 @@ public class RedissonConfig {
} }
Config config = new Config(); Config config = new Config();
ClusterServersConfig clusterServersConfig = config.useClusterServers() ClusterServersConfig clusterServersConfig = config.useClusterServers()
.setScanInterval(2000) // 集群状态扫描间隔时间,单位是毫秒 .setScanInterval(2000) // 集群状态扫描间隔时间,单位是毫秒
.addNodeAddress(clusterNodes.toArray(new String[clusterNodes.size()])); .addNodeAddress(clusterNodes.toArray(new String[clusterNodes.size()]));
...@@ -56,19 +55,19 @@ public class RedissonConfig { ...@@ -56,19 +55,19 @@ public class RedissonConfig {
* 单机模式 redisson 客户端 * 单机模式 redisson 客户端
*/ */
@Bean // @Bean
@ConditionalOnProperty(name = "spring.redis.mode", havingValue = "single") // @ConditionalOnProperty(name = "spring.redis.mode", havingValue = "single")
RedissonClient redissonSingle() { // RedissonClient redissonSingle() {
Config config = new Config(); // Config config = new Config();
String node = redisConfigProperties.getRedissonUrl(); // String node = redisConfigProperties.getRedissonUrl();
node = node.startsWith("redis://") ? node : "redis://" + node; // node = node.startsWith("redis://") ? node : "redis://" + node;
SingleServerConfig serverConfig = config.useSingleServer() // SingleServerConfig serverConfig = config.useSingleServer()
.setAddress(node); // .setAddress(node);
if (StringUtils.isNotBlank(redisConfigProperties.getPassword())) { // if (StringUtils.isNotBlank(redisConfigProperties.getPassword())) {
serverConfig.setPassword(redisConfigProperties.getPassword()); // serverConfig.setPassword(redisConfigProperties.getPassword());
} // }
return Redisson.create(config); // return Redisson.create(config);
} // }
} }
\ No newline at end of file
...@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.common.utils.DateUtils; ...@@ -6,6 +6,7 @@ import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.service.IAnalysisReportLogService; import com.yeejoin.equipmanage.service.IAnalysisReportLogService;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -25,19 +26,22 @@ public class AnalysisReportSchedulerJob { ...@@ -25,19 +26,22 @@ public class AnalysisReportSchedulerJob {
@Autowired @Autowired
private IAnalysisReportLogService iAnalysisReportLogService; private IAnalysisReportLogService iAnalysisReportLogService;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Value("${spring.redis.mode}")
private String cluster;
/** /**
* 每天凌晨0点-日报生成 * 每天凌晨0点-日报生成
*/ */
@Scheduled(cron = "0 0 0 * * ?") @Scheduled(cron = "0 0 0 * * ?")
public void dayReport() throws ParseException { public void dayReport() throws ParseException {
if(cluster.equals("cluster")){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "dayReport" + time; String jobName = "dayReport" + time;
...@@ -56,9 +60,24 @@ public class AnalysisReportSchedulerJob { ...@@ -56,9 +60,24 @@ public class AnalysisReportSchedulerJob {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException();
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
try {
Date beginDate = DateUtils.dateAdd(new Date(), -1, false);
Date endDate = DateUtils.dateAdd(new Date(), -1, false);
iAnalysisReportLogService.generateReport(AnalysisReportEnum.DAY_REPORT, beginDate, endDate);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
}
}
...@@ -69,8 +88,12 @@ public class AnalysisReportSchedulerJob { ...@@ -69,8 +88,12 @@ public class AnalysisReportSchedulerJob {
*/ */
@Scheduled(cron = "0 0 0 ? * 1") @Scheduled(cron = "0 0 0 ? * 1")
public void weekReport() throws ParseException { public void weekReport() throws ParseException {
if(cluster.equals("cluster")) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time = format.format(new Date());
String jobName = "weekReport" + time; String jobName = "weekReport" + time;
...@@ -92,16 +115,23 @@ public class AnalysisReportSchedulerJob { ...@@ -92,16 +115,23 @@ public class AnalysisReportSchedulerJob {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
Date yestDay = DateUtils.dateAdd(new Date(), -1, false);
Date beginDate = DateUtils.getFirstDayOfWeek(yestDay);
Date endDate = DateUtils.getLastDayOfWeek(yestDay);
iAnalysisReportLogService.generateReport(AnalysisReportEnum.WEEK_REPORT, beginDate, endDate);
} }
}
/** /**
* 每月第1天凌晨0-月报生成 * 每月第1天凌晨0-月报生成
*/ */
@Scheduled(cron="0 0 0 1 * ?") @Scheduled(cron="0 0 0 1 * ?")
public void monthReport() throws ParseException { public void monthReport() throws ParseException {
if(cluster.equals("cluster")) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time = format.format(new Date());
String jobName = "monthReport" + time; String jobName = "monthReport" + time;
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
...@@ -122,6 +152,12 @@ public class AnalysisReportSchedulerJob { ...@@ -122,6 +152,12 @@ public class AnalysisReportSchedulerJob {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
Date yestDay = DateUtils.dateAdd(new Date(), -1, false);
Date beginDate = DateUtils.getFirstDayOfMonth(yestDay);
Date endDate = DateUtils.getLastDayOfMonth(yestDay);
iAnalysisReportLogService.generateMonthReport(AnalysisReportEnum.MONTH_REPORT, beginDate, endDate);
} }
}
} }
...@@ -13,6 +13,7 @@ import java.util.List; ...@@ -13,6 +13,7 @@ import java.util.List;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -49,8 +50,11 @@ public class View3dController extends AbstractBaseController { ...@@ -49,8 +50,11 @@ public class View3dController extends AbstractBaseController {
private IRiskSourceService riskSourceService; private IRiskSourceService riskSourceService;
@Autowired @Autowired
private IView3dService view3dService; private IView3dService view3dService;
@Autowired
@Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
...@@ -228,7 +232,7 @@ public class View3dController extends AbstractBaseController { ...@@ -228,7 +232,7 @@ public class View3dController extends AbstractBaseController {
@Scheduled(cron = "${param.safetyIndexChange.cron}") @Scheduled(cron = "${param.safetyIndexChange.cron}")
public CommonResponse safetyIndexLog(){ public CommonResponse safetyIndexLog(){
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "fas-2" + time; String jobName = "fas-2" + time;
...@@ -252,6 +256,12 @@ public class View3dController extends AbstractBaseController { ...@@ -252,6 +256,12 @@ public class View3dController extends AbstractBaseController {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
view3dService.safetyIndexLogGenJob(null);
}
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
......
...@@ -12,6 +12,7 @@ import org.redisson.api.RedissonClient; ...@@ -12,6 +12,7 @@ import org.redisson.api.RedissonClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -25,15 +26,17 @@ public class FireScheduled { ...@@ -25,15 +26,17 @@ public class FireScheduled {
@Autowired @Autowired
IContingencyInstance iContingencyInstance; IContingencyInstance iContingencyInstance;
@Autowired @Autowired(required = false)
RedissonClient redisson; RedissonClient redisson;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Value("${spring.redis.mode}")
private String cluster;
@Scheduled(cron = "*/2 * * * * ?") @Scheduled(cron = "*/2 * * * * ?")
public void runFireQueue() throws Exception { public void runFireQueue() throws Exception {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
...@@ -80,6 +83,31 @@ public class FireScheduled { ...@@ -80,6 +83,31 @@ public class FireScheduled {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (fireQueue.size() == 0)
return;
Map<String, String> map = fireQueue.getFirst();
String batchNo = map.get("batchNo");
String stepCode = map.get("stepCode");
String buttonCode = map.get("buttonCode");
String confirm = map.get("confirm");
String contingencyPlanId = map.get("contingencyPlanId");
String stepState = map.get("stepState");
// String token = map.get("token");
// String product = map.get("product");
log.info("fireQueue-size:" + fireQueue.size());
log.info("stepCode:" + map.get("stepCode"));
log.info("buttonCode:" + map.get("buttonCode"));
log.info("confirm:" + map.get("confirm"));
log.info("stepState:" + map.get("stepState"));
// RequestContext.setToken(token);
// RequestContext.setProduct(product);
iContingencyInstance.setButtonExecuted(batchNo, contingencyPlanId, buttonCode, confirm);
iContingencyInstance.fire(batchNo, stepCode, contingencyPlanId, buttonCode, confirm, stepState);
}
} }
public static LinkedList<Map<String, String>> getFireQueue() { public static LinkedList<Map<String, String>> getFireQueue() {
return fireQueue; return fireQueue;
......
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.knowledgebase.face.service.DocAuditService; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.knowledgebase.face.service.DocAuditService;
import com.yeejoin.amos.knowledgebase.face.service.InteractionCountService; import com.yeejoin.amos.knowledgebase.face.service.InteractionCountService;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -37,8 +38,12 @@ public class QuoteCountFlushTiming { ...@@ -37,8 +38,12 @@ public class QuoteCountFlushTiming {
@Autowired @Autowired
private ConfigLoader configLoader; private ConfigLoader configLoader;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -55,6 +60,7 @@ public class QuoteCountFlushTiming { ...@@ -55,6 +60,7 @@ public class QuoteCountFlushTiming {
@Transactional(rollbackFor = {Exception.class, BaseException.class}) @Transactional(rollbackFor = {Exception.class, BaseException.class})
public void flushTagQuoteCount() { public void flushTagQuoteCount() {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "knowledgeBase-1" +time; String jobName = "knowledgeBase-1" +time;
...@@ -85,16 +91,27 @@ public class QuoteCountFlushTiming { ...@@ -85,16 +91,27 @@ public class QuoteCountFlushTiming {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (needFlush.get()) {
needFlush.set(false);
interactionCountService.deleteAllTagQuote();
List<KnowledgeInteractionCount> allTagQuoteRecords = interactionCountService.getAllTagQuoteRecords();
if (!allTagQuoteRecords.isEmpty()) {
allTagQuoteRecords.forEach(e -> e.setAgencyCode(configLoader.getAgencyCode()));
boolean finished = interactionCountService.saveBatch(allTagQuoteRecords);
System.out.println("定时-刷新标签引用数-" + (finished ? "完成" : "失败"));
}
}
}
} }
@Scheduled(fixedRate = 3 * 1000) @Scheduled(fixedRate = 3 * 1000)
@Transactional(rollbackFor = {Exception.class, BaseException.class}) @Transactional(rollbackFor = {Exception.class, BaseException.class})
public void pushDocs2Rule() { public void pushDocs2Rule() {
if("cluster".equals(cluster)) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time = format.format(new Date());
String jobName = "knowledgeBase-2" + time; String jobName = "knowledgeBase-2" + time;
...@@ -118,7 +135,13 @@ public class QuoteCountFlushTiming { ...@@ -118,7 +135,13 @@ public class QuoteCountFlushTiming {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (needPush2Rule.get()) {
needPush2Rule.set(false);
docAuditService.pushDocs2RuleByMQ();
System.out.println("定时-同步规则-完成");
}
}
} }
} }
...@@ -77,8 +77,13 @@ public class JobService implements IJobService { ...@@ -77,8 +77,13 @@ public class JobService implements IJobService {
private String patrolTopic; private String patrolTopic;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -304,6 +309,9 @@ public class JobService implements IJobService { ...@@ -304,6 +309,9 @@ public class JobService implements IJobService {
@Transactional @Transactional
public void taskJobPerform(long taskId, String jobType, String jobName) { public void taskJobPerform(long taskId, String jobType, String jobName) {
if("cluster".equals(cluster)){
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
try { try {
...@@ -349,7 +357,38 @@ public class JobService implements IJobService { ...@@ -349,7 +357,38 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iTaskDao.existsById(taskId)) {
Task task = iTaskDao.findById(taskId).get();
Toke toke = remoteSecurityService.getServerToken();
if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (TaskStatusEnum.UNDERWAY.getValue() == task.getStatus()) {
task.setStatus(TaskStatusEnum.OVERTIME.getValue());
iTaskDao.saveAndFlush(task);
TaskFeedback taskFeedback = new TaskFeedback();
taskFeedback.setUserId(task.getExecutorId());
taskFeedback.setMessage("该任务在规定时间内未完成,请核实信息!任务名称: " + task.getTitle() + " 要求完成时间: "
+ DateUtil.getDateFormat(task.getFinishTime(), "yyyy-MM-dd HH:mm:ss") + " 发起人:"
+ task.getPublisherName() + " 执行人:" + task.getExecutor());
taskFeedback.setCreateDate(new Date());
taskFeedback.setUserName(task.getExecutor());
taskFeedback.setFeedbackTime(new Date());
taskFeedback.setOrgCode(task.getOrgCode());
taskFeedback.setTaskId(task.getId());
taskFeedback.setMessageType(TaskStatusEnum.OVERTIME.getName());
taskFeedback = taskFeedbackDao.save(taskFeedback);
try {
asyncTask.pushTaskDetailInfoTo3D(toke.getToke(), toke.getProduct(), toke.getAppKey(), taskId); // 超时任务向3D推送
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
} else {
messageService.pushTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), task);
}
}
removeJob(jobName);
}
} }
@Override @Override
...@@ -407,7 +446,7 @@ public class JobService implements IJobService { ...@@ -407,7 +446,7 @@ public class JobService implements IJobService {
@Override @Override
public void msgJobPerform(long msgId, String jobType, String jobName) { public void msgJobPerform(long msgId, String jobType, String jobName) {
if("cluster".equals(cluster)) {
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
try { try {
...@@ -429,5 +468,17 @@ public class JobService implements IJobService { ...@@ -429,5 +468,17 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (!redisUtils.hasKey(jobName + "_redisson_key")) {
redisUtils.set(jobName + "_redisson_key", "1");//增加标识
if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get();
Toke toke = remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), msg);
}
removeJob(jobName);
}
}
} }
} }
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService; import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -20,8 +21,11 @@ import java.util.concurrent.TimeUnit; ...@@ -20,8 +21,11 @@ import java.util.concurrent.TimeUnit;
@EnableScheduling @EnableScheduling
public class PlanTaskJob { public class PlanTaskJob {
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -34,7 +38,7 @@ public class PlanTaskJob { ...@@ -34,7 +38,7 @@ public class PlanTaskJob {
@Scheduled(cron = "${jobs.cron}") @Scheduled(cron = "${jobs.cron}")
public void scheduleJob() { public void scheduleJob() {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "maintenance-1" + time; String jobName = "maintenance-1" + time;
...@@ -55,7 +59,11 @@ public class PlanTaskJob { ...@@ -55,7 +59,11 @@ public class PlanTaskJob {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
planTaskService.taskExecution(null);
}
} }
...@@ -65,9 +73,9 @@ public class PlanTaskJob { ...@@ -65,9 +73,9 @@ public class PlanTaskJob {
*/ */
@Scheduled(cron = "${jobs.cron}") @Scheduled(cron = "${jobs.cron}")
public void taskMessage() { public void taskMessage() {
if("cluster".equals(cluster)) {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time = format.format(new Date());
String jobName = "maintenance-2" + time; String jobName = "maintenance-2" + time;
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
...@@ -85,7 +93,9 @@ public class PlanTaskJob { ...@@ -85,7 +93,9 @@ public class PlanTaskJob {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
planTaskService.taskMessage(null);
}
} }
......
...@@ -30,6 +30,7 @@ import org.redisson.api.RLock; ...@@ -30,6 +30,7 @@ import org.redisson.api.RLock;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -71,9 +72,12 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -71,9 +72,12 @@ public class PlanTaskController extends AbstractBaseController {
/* @Autowired /* @Autowired
private IUserService userService;*/ private IUserService userService;*/
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -418,7 +422,7 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -418,7 +422,7 @@ public class PlanTaskController extends AbstractBaseController {
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8") @RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() { public CommonResponse pushCarData() {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "pushCarData" +time; String jobName = "pushCarData" +time;
...@@ -446,6 +450,11 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -446,6 +450,11 @@ public class PlanTaskController extends AbstractBaseController {
}finally { }finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskExecution(null);
}
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} }
...@@ -454,6 +463,8 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -454,6 +463,8 @@ public class PlanTaskController extends AbstractBaseController {
*/ */
@Scheduled(cron = "${jobs.cron}") @Scheduled(cron = "${jobs.cron}")
public void taskMessage() { public void taskMessage() {
if("cluster".equals(cluster)) {
String jobName = "taskMessage" + System.currentTimeMillis(); String jobName = "taskMessage" + System.currentTimeMillis();
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
...@@ -472,7 +483,11 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -472,7 +483,11 @@ public class PlanTaskController extends AbstractBaseController {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskMessage(null);
}
} }
......
...@@ -96,8 +96,11 @@ public class JobService implements IJobService { ...@@ -96,8 +96,11 @@ public class JobService implements IJobService {
@Autowired @Autowired
JcsFeignClient jcsFeignClient; JcsFeignClient jcsFeignClient;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -658,6 +661,8 @@ public class JobService implements IJobService { ...@@ -658,6 +661,8 @@ public class JobService implements IJobService {
@Override @Override
@Transactional @Transactional
public void taskJobPerform(long taskId, String jobType, String jobName) { public void taskJobPerform(long taskId, String jobType, String jobName) {
if("cluster".equals(cluster)){
// TODO Auto-generated method stub // TODO Auto-generated method stub
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
...@@ -707,6 +712,40 @@ public class JobService implements IJobService { ...@@ -707,6 +712,40 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iTaskDao.existsById(taskId)) {
Task task = iTaskDao.findById(taskId).get();
Toke toke = remoteSecurityService.getServerToken();
if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (TaskStatusEnum.UNDERWAY.getValue() == task.getStatus()) {
task.setStatus(TaskStatusEnum.OVERTIME.getValue());
iTaskDao.saveAndFlush(task);
TaskFeedback taskFeedback = new TaskFeedback();
taskFeedback.setUserId(task.getExecutorId());
taskFeedback.setMessage("该任务在规定时间内未完成,请核实信息!任务名称: " + task.getTitle() + " 要求完成时间: "
+ DateUtil.getDateFormat(task.getFinishTime(), "yyyy-MM-dd HH:mm:ss") + " 发起人:"
+ task.getPublisherName() + " 执行人:" + task.getExecutor());
taskFeedback.setCreateDate(new Date());
taskFeedback.setUserName(task.getExecutor());
taskFeedback.setFeedbackTime(new Date());
taskFeedback.setOrgCode(task.getOrgCode());
taskFeedback.setTaskId(task.getId());
taskFeedback.setMessageType(TaskStatusEnum.OVERTIME.getName());
taskFeedback = taskFeedbackDao.save(taskFeedback);
try {
asyncTask.pushTaskDetailInfoTo3D(toke.getToke(), toke.getProduct(), toke.getAppKey(), taskId); // 超时任务向3D推送
} catch (InterruptedException e) {
// TODO Auto-generated catch block
log.error(e.getMessage(), e);
e.printStackTrace();
}
}
} else {
messageService.pushTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), task);
}
}
removeJob(jobName);
}
} }
...@@ -765,13 +804,15 @@ public class JobService implements IJobService { ...@@ -765,13 +804,15 @@ public class JobService implements IJobService {
@Override @Override
@Transactional @Transactional
public void planTaskJobPerform(long planTaskId, String jobType, String jobName) { public void planTaskJobPerform(long planTaskId, String jobType, String jobName) {
if("cluster".equals(cluster)) {
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
try { try {
//拿锁失败10停止尝试, 任务执行超时默认续30s 每个10秒续到30 //拿锁失败10停止尝试, 任务执行超时默认续30s 每个10秒续到30
lock.tryLock(10, TimeUnit.SECONDS); lock.tryLock(10, TimeUnit.SECONDS);
System.out.println("获取锁成功============"); System.out.println("获取锁成功============");
if(!redisUtils.hasKey(jobName+"_redisson_key")){ if (!redisUtils.hasKey(jobName + "_redisson_key")) {
redisUtils.set(jobName+"_redisson_key","1");//增加标识 redisUtils.set(jobName + "_redisson_key", "1");//增加标识
if (iPlanTaskDao.existsById(planTaskId)) { if (iPlanTaskDao.existsById(planTaskId)) {
PlanTask planTask = iPlanTaskDao.findById(planTaskId).get(); PlanTask planTask = iPlanTaskDao.findById(planTaskId).get();
...@@ -785,8 +826,8 @@ public class JobService implements IJobService { ...@@ -785,8 +826,8 @@ public class JobService implements IJobService {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue()); updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
} }
} else { } else {
Toke toke= remoteSecurityService.getServerToken(); Toke toke = remoteSecurityService.getServerToken();
messageService.pushPlanTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(),planTask, jobType); messageService.pushPlanTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), planTask, jobType);
} }
} }
removeJob(jobName); removeJob(jobName);
...@@ -796,7 +837,25 @@ public class JobService implements IJobService { ...@@ -796,7 +837,25 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iPlanTaskDao.existsById(planTaskId)) {
PlanTask planTask = iPlanTaskDao.findById(planTaskId).get();
if (XJConstant.STATUS_MONITOR_START.equals(jobType)) {
if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.save(planTask);
}
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
}
} else {
Toke toke = remoteSecurityService.getServerToken();
messageService.pushPlanTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), planTask, jobType);
}
}
removeJob(jobName);
}
} }
@Override @Override
...@@ -806,18 +865,19 @@ public class JobService implements IJobService { ...@@ -806,18 +865,19 @@ public class JobService implements IJobService {
@Override @Override
public void msgJobPerform(long msgId, String jobType, String jobName) { public void msgJobPerform(long msgId, String jobType, String jobName) {
if("cluster".equals(cluster)) {
RLock lock = redisson.getLock(jobName); RLock lock = redisson.getLock(jobName);
try { try {
//拿锁失败10停止尝试, 任务执行超时默认续30s 每个10秒续到30 //拿锁失败10停止尝试, 任务执行超时默认续30s 每个10秒续到30
lock.tryLock(10, TimeUnit.SECONDS); lock.tryLock(10, TimeUnit.SECONDS);
//为了防止重复 //为了防止重复
if(!redisUtils.hasKey(jobName+"_redisson_key")){ if (!redisUtils.hasKey(jobName + "_redisson_key")) {
redisUtils.set(jobName+"_redisson_key","1");//增加标识 redisUtils.set(jobName + "_redisson_key", "1");//增加标识
if (iMsgDao.existsById(msgId)) { if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get(); Msg msg = iMsgDao.findById(msgId).get();
Toke toke= remoteSecurityService.getServerToken(); Toke toke = remoteSecurityService.getServerToken();
messageService.pushMsgAndSave(toke.getToke(), toke.getProduct(), toke.getAppKey(),msg); messageService.pushMsgAndSave(toke.getToke(), toke.getProduct(), toke.getAppKey(), msg);
} }
removeJob(jobName); removeJob(jobName);
} }
...@@ -826,7 +886,14 @@ public class JobService implements IJobService { ...@@ -826,7 +886,14 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get();
Toke toke = remoteSecurityService.getServerToken();
messageService.pushMsgAndSave(toke.getToke(), toke.getProduct(), toke.getAppKey(), msg);
}
removeJob(jobName);
}
} }
} }
...@@ -3,6 +3,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -3,6 +3,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.patrol.business.service.intfc.ILatentDangerService; import com.yeejoin.amos.patrol.business.service.intfc.ILatentDangerService;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
...@@ -21,9 +22,12 @@ public class LatentDanerScheduled { ...@@ -21,9 +22,12 @@ public class LatentDanerScheduled {
@Autowired @Autowired
private ILatentDangerService iLatentDangerService; private ILatentDangerService iLatentDangerService;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -34,6 +38,7 @@ public class LatentDanerScheduled { ...@@ -34,6 +38,7 @@ public class LatentDanerScheduled {
@Scheduled(cron = "0 0/1 * * * ?") @Scheduled(cron = "0 0/1 * * * ?")
public void updateDangerStateOfOvertime() { public void updateDangerStateOfOvertime() {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "updateDangerStateOfOvertime" +time; String jobName = "updateDangerStateOfOvertime" +time;
...@@ -55,7 +60,9 @@ public class LatentDanerScheduled { ...@@ -55,7 +60,9 @@ public class LatentDanerScheduled {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
iLatentDangerService.updateDangerStateOfOvertime();
}
......
...@@ -103,9 +103,12 @@ public class JobService implements IJobService { ...@@ -103,9 +103,12 @@ public class JobService implements IJobService {
private String patrolTopic; private String patrolTopic;
@Autowired @Autowired
private WebMqttComponent webMqttComponent; private WebMqttComponent webMqttComponent;
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -304,7 +307,7 @@ public class JobService implements IJobService { ...@@ -304,7 +307,7 @@ public class JobService implements IJobService {
@Override @Override
@Transactional @Transactional
public void taskJobPerform(long taskId, String jobType, String jobName) { public void taskJobPerform(long taskId, String jobType, String jobName) {
if("cluster".equals(cluster)){
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName + "_redisson"); RLock lock = redisson.getLock(jobName + "_redisson");
try { try {
...@@ -350,6 +353,38 @@ public class JobService implements IJobService { ...@@ -350,6 +353,38 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iTaskDao.existsById(taskId)) {
Task task = iTaskDao.findById(taskId).get();
Toke toke = remoteSecurityService.getServerToken();
if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (TaskStatusEnum.UNDERWAY.getValue() == task.getStatus()) {
task.setStatus(TaskStatusEnum.OVERTIME.getValue());
iTaskDao.saveAndFlush(task);
TaskFeedback taskFeedback = new TaskFeedback();
taskFeedback.setUserId(task.getExecutorId());
taskFeedback.setMessage("该任务在规定时间内未完成,请核实信息!任务名称: " + task.getTitle() + " 要求完成时间: "
+ DateUtil.getDateFormat(task.getFinishTime(), "yyyy-MM-dd HH:mm:ss") + " 发起人:"
+ task.getPublisherName() + " 执行人:" + task.getExecutor());
taskFeedback.setCreateDate(new Date());
taskFeedback.setUserName(task.getExecutor());
taskFeedback.setFeedbackTime(new Date());
taskFeedback.setOrgCode(task.getOrgCode());
taskFeedback.setTaskId(task.getId());
taskFeedback.setMessageType(TaskStatusEnum.OVERTIME.getName());
taskFeedback = taskFeedbackDao.save(taskFeedback);
try {
asyncTask.pushTaskDetailInfoTo3D(toke.getToke(), toke.getProduct(), toke.getAppKey(), taskId); // 超时任务向3D推送
} catch (InterruptedException e) {
log.error(e.getMessage(), e);
}
}
} else {
messageService.pushTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), task);
}
}
removeJob(jobName);
}
} }
@Override @Override
...@@ -405,6 +440,7 @@ public class JobService implements IJobService { ...@@ -405,6 +440,7 @@ public class JobService implements IJobService {
@Override @Override
@Transactional @Transactional
public void planTaskJobPerform(long planTaskId, String jobType, String jobName) { public void planTaskJobPerform(long planTaskId, String jobType, String jobName) {
if("cluster".equals(cluster)) {
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName + "_redisson"); RLock lock = redisson.getLock(jobName + "_redisson");
try { try {
...@@ -415,8 +451,6 @@ public class JobService implements IJobService { ...@@ -415,8 +451,6 @@ public class JobService implements IJobService {
redisUtils.set(jobName + "_redisson_key", "1");//增加标识 redisUtils.set(jobName + "_redisson_key", "1");//增加标识
if (iPlanTaskDao.existsById(planTaskId)) { if (iPlanTaskDao.existsById(planTaskId)) {
PlanTask planTask = iPlanTaskDao.findById(planTaskId).get(); PlanTask planTask = iPlanTaskDao.findById(planTaskId).get();
if (XJConstant.STATUS_MONITOR_START.equals(jobType)) { if (XJConstant.STATUS_MONITOR_START.equals(jobType)) {
...@@ -440,7 +474,25 @@ public class JobService implements IJobService { ...@@ -440,7 +474,25 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iPlanTaskDao.existsById(planTaskId)) {
PlanTask planTask = iPlanTaskDao.findById(planTaskId).get();
if (XJConstant.STATUS_MONITOR_START.equals(jobType)) {
if (PlanTaskFinishStatusEnum.NOTSTARTED.getValue() == planTask.getFinishStatus()) {
planTask.setFinishStatus(PlanTaskFinishStatusEnum.UNDERWAY.getValue());
iPlanTaskDao.save(planTask);
}
} else if (XJConstant.STATUS_MONITOR_END.equals(jobType)) {
if (PlanTaskFinishStatusEnum.UNDERWAY.getValue() == planTask.getFinishStatus()) {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
}
} else {
Toke toke = remoteSecurityService.getServerToken();
messageService.pushPlanTaskMessage(toke.getToke(), toke.getProduct(), toke.getAppKey(), planTask, jobType);
}
}
removeJob(jobName);
}
} }
@Override @Override
...@@ -450,6 +502,7 @@ public class JobService implements IJobService { ...@@ -450,6 +502,7 @@ public class JobService implements IJobService {
@Override @Override
public void msgJobPerform(long msgId, String jobType, String jobName) { public void msgJobPerform(long msgId, String jobType, String jobName) {
if("cluster".equals(cluster)) {
//为了便于区分key,增加后缀_redisson //为了便于区分key,增加后缀_redisson
RLock lock = redisson.getLock(jobName + "_redisson"); RLock lock = redisson.getLock(jobName + "_redisson");
try { try {
...@@ -471,6 +524,14 @@ public class JobService implements IJobService { ...@@ -471,6 +524,14 @@ public class JobService implements IJobService {
} finally { } finally {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
if (iMsgDao.existsById(msgId)) {
Msg msg = iMsgDao.findById(msgId).get();
Toke toke = remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(), toke.getProduct(), toke.getAppKey(), msg);
}
removeJob(jobName);
}
} }
} }
...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -4,6 +4,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService; import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -20,8 +21,11 @@ import java.util.concurrent.TimeUnit; ...@@ -20,8 +21,11 @@ import java.util.concurrent.TimeUnit;
@EnableScheduling @EnableScheduling
public class PlanTaskJob { public class PlanTaskJob {
@Autowired @Autowired(required = false)
org.redisson.api.RedissonClient redisson; org.redisson.api.RedissonClient redisson;
@Value("${spring.redis.mode}")
private String cluster;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
...@@ -34,7 +38,7 @@ public class PlanTaskJob { ...@@ -34,7 +38,7 @@ public class PlanTaskJob {
@Scheduled(cron = "${jobs.cron}") @Scheduled(cron = "${jobs.cron}")
public void scheduleJob() { public void scheduleJob() {
if("cluster".equals(cluster)){
DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm"); DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
String time=format.format(new Date()); String time=format.format(new Date());
String jobName = "supervision-1" +time; String jobName = "supervision-1" +time;
...@@ -56,5 +60,8 @@ public class PlanTaskJob { ...@@ -56,5 +60,8 @@ public class PlanTaskJob {
lock.unlock(); //释放锁 lock.unlock(); //释放锁
} }
}else{
planTaskService.taskExecution(null);
}
} }
} }
...@@ -186,12 +186,11 @@ spring.redis.database=1 ...@@ -186,12 +186,11 @@ spring.redis.database=1
spring.redis.timeout=10000 spring.redis.timeout=10000
spring.redis.password=yeejoin@2020 spring.redis.password=yeejoin@2020
spring.redis.expire.time=300 spring.redis.expire.time=300
#单机集群判断 cluster集群 single单机 #单机集群判断 cluster
spring.redis.mode=single spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.10.211 spring.redis.host=172.16.10.211
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.10.211:6379
......
...@@ -175,7 +175,6 @@ spring.redis.mode=single ...@@ -175,7 +175,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
spring.data.elasticsearch.repositories.enabled=true spring.data.elasticsearch.repositories.enabled=true
......
...@@ -81,7 +81,6 @@ spring.redis.mode=single ...@@ -81,7 +81,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
#注册中心地址 #注册中心地址
eureka.client.service-url.defaultZone =http://172.16.10.72:10001/eureka/ eureka.client.service-url.defaultZone =http://172.16.10.72:10001/eureka/
......
...@@ -146,7 +146,6 @@ spring.redis.mode=single ...@@ -146,7 +146,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
......
...@@ -124,7 +124,6 @@ spring.redis.mode=single ...@@ -124,7 +124,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
......
...@@ -151,7 +151,6 @@ spring.redis.mode=single ...@@ -151,7 +151,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
......
...@@ -129,7 +129,6 @@ spring.redis.mode=single ...@@ -129,7 +129,6 @@ spring.redis.mode=single
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.10.211 spring.redis.host=172.16.10.211
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.10.211:6379
......
...@@ -85,7 +85,6 @@ spring.redis.jedis.pool.min-idle=1 ...@@ -85,7 +85,6 @@ spring.redis.jedis.pool.min-idle=1
#redis 单机配置 #redis 单机配置
spring.redis.host=172.16.11.20 spring.redis.host=172.16.11.20
spring.redis.port=6379 spring.redis.port=6379
spring.redis.redissonUrl=172.16.11.20:6379
spring.data.elasticsearch.repositories.enabled=true spring.data.elasticsearch.repositories.enabled=true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment