|
|
@@ -1,5 +1,6 @@
|
|
|
package com.evps.comm.server.xnet.server.process.response;
|
|
|
|
|
|
+import com.evps.comm.server.config.ApplicationConfig;
|
|
|
import com.evps.comm.server.kafka.KafkaProducerService;
|
|
|
import com.evps.comm.server.process.dbms.DbmsData;
|
|
|
import com.evps.comm.server.process.dbms.DbmsDataProcess;
|
|
|
@@ -30,6 +31,7 @@ distance 잔여 거리 Integer 4 (단위: m), 목적지
|
|
|
public class EvpsEvent implements EvpsCommResponse {
|
|
|
private final DbmsDataProcess dbmsDataProcess;
|
|
|
private final KafkaProducerService kafkaProducerService;
|
|
|
+ private final ApplicationConfig config;
|
|
|
|
|
|
@Override
|
|
|
public boolean response(RecvPacketDto packet) {
|
|
|
@@ -86,12 +88,6 @@ public class EvpsEvent implements EvpsCommResponse {
|
|
|
log.info("[{}]. EvpsEvent.response: Service Id: {}, {}", center.getLogKey(), packet.getPacket().getServiceId(), eventDto);
|
|
|
}
|
|
|
|
|
|
- // kafka 전송
|
|
|
- this.kafkaProducerService.sendEvpsEventTopic(eventDto);
|
|
|
-
|
|
|
- // 이벤트 정보 입력(차량 이동)
|
|
|
- this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INS_EVENT, center, eventDto));
|
|
|
-
|
|
|
KafkaEvpsServiceDto service = ApplicationRepository.getService(eventDto.getServiceId());
|
|
|
if (service == null) {
|
|
|
log.error("[{}]. EvpsEvent.response: Service Id: {}, Not Found Service Information.", center.getLogKey(), eventDto.getServiceId());
|
|
|
@@ -103,6 +99,22 @@ public class EvpsEvent implements EvpsCommResponse {
|
|
|
service.setServiceDist(eventDto.getRemDist());
|
|
|
service.updateLastCommTime();
|
|
|
}
|
|
|
+
|
|
|
+ // 경남청 이벤트가 1초에 수십건씩 들어오는게 있어서 여기서 시간을 계산해서 처리함
|
|
|
+ if (service != null && this.config.isCheckEventTimeGap()) {
|
|
|
+ if (!service.isValidEvent()) {
|
|
|
+ // 이전 이벤트가 1초 이내에 들어오면 무시
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ service.updateLastEventTime();
|
|
|
+ }
|
|
|
+
|
|
|
+ // kafka 전송
|
|
|
+ this.kafkaProducerService.sendEvpsEventTopic(eventDto);
|
|
|
+
|
|
|
+ // 이벤트 정보 입력(차량 이동)
|
|
|
+ this.dbmsDataProcess.add(new DbmsData(DbmsData.DBMS_DATA_INS_EVENT, center, eventDto));
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
}
|