增加稳定性,往后偏移10分钟获取最新计划消息。
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.concurrent.Executors;
|
|||||||
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.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -24,6 +25,8 @@ public class AppRunner implements CommandLineRunner {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ICmoutmsgService cmoutmsgService;
|
private ICmoutmsgService cmoutmsgService;
|
||||||
|
|
||||||
|
@Value("${msgExchange.waitDateLeftOffset}")
|
||||||
|
private Long waitDateLeftOffset;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run(String... args) throws Exception {
|
public void run(String... args) throws Exception {
|
||||||
@@ -32,11 +35,12 @@ public class AppRunner implements CommandLineRunner {
|
|||||||
|
|
||||||
|
|
||||||
Date nowDate = new Date();
|
Date nowDate = new Date();
|
||||||
|
Date waitDate = new Date(nowDate.getTime() - waitDateLeftOffset);//往后偏移指定时钟,避免因不同应用系统时钟相差过大导致的问题。
|
||||||
cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
|
cmoutmsgService.sendSchdGetMsg(null,null);//发送获取当天日计划的申请
|
||||||
|
|
||||||
//
|
//
|
||||||
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
|
redisService.set(RedisKeyConstant.KEY_ISWAITSCHD, true); //等待返回日计划状态
|
||||||
redisService.set(RedisKeyConstant.KEY_WAITSCHDDATE,nowDate); //初始化消息进度
|
redisService.set(RedisKeyConstant.KEY_WAITSCHDDATE,waitDate); //初始化消息进度
|
||||||
|
|
||||||
logger.info("发送获取动态航班日计划的消息完成");
|
logger.info("发送获取动态航班日计划的消息完成");
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ kafka:
|
|||||||
id: test
|
id: test
|
||||||
msgExchange:
|
msgExchange:
|
||||||
intervalSeconds: 5
|
intervalSeconds: 5
|
||||||
|
waitDateLeftOffset: 600000
|
||||||
logstash:
|
logstash:
|
||||||
host: 130.120.3.233:5000
|
host: 130.120.3.233:5000
|
||||||
scheduled:
|
scheduled:
|
||||||
|
|||||||
Reference in New Issue
Block a user