增加稳定性,往后偏移10分钟获取最新计划消息。

This commit is contained in:
zhouxiunai
2018-12-26 17:44:55 +08:00
parent 50c3a58e05
commit 440864110e
2 changed files with 6 additions and 1 deletions
@@ -6,6 +6,7 @@ import java.util.concurrent.Executors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
@@ -24,6 +25,8 @@ public class AppRunner implements CommandLineRunner {
@Autowired
private ICmoutmsgService cmoutmsgService;
@Value("${msgExchange.waitDateLeftOffset}")
private Long waitDateLeftOffset;
@Override
public void run(String... args) throws Exception {
@@ -32,11 +35,12 @@ public class AppRunner implements CommandLineRunner {
Date nowDate = new Date();
Date waitDate = new Date(nowDate.getTime() - waitDateLeftOffset);//往后偏移指定时钟,避免因不同应用系统时钟相差过大导致的问题。
cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
//
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
redisService.set(RedisKeyConstant.KEY_WAITSCHDDATE,nowDate); //初始化消息进度
redisService.set(RedisKeyConstant.KEY_WAITSCHDDATE,waitDate); //初始化消息进度
logger.info("发送获取动态航班日计划的消息完成");
+1
View File
@@ -51,6 +51,7 @@ kafka:
id: test
msgExchange:
intervalSeconds: 5
waitDateLeftOffset: 600000
logstash:
host: 130.120.3.233:5000
scheduled: