diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml b/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml index ebf05ed..16ac173 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml @@ -80,33 +80,24 @@ com.couplet couplet-common-swagger - - - - org.eclipse.paho - org.eclipse.paho.client.mqttv3 - 1.2.5 - com.couplet couplet-common-event + - org.springframework.kafka - spring-kafka + org.apache.kafka + kafka-clients + 2.8.0 + com.couplet couplet-common-business - - - org.springframework.boot - spring-boot-starter-amqp - diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java index a3821dd..552a5bd 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/RealTimeDataServiceImpl.java @@ -41,19 +41,18 @@ public class RealTimeDataServiceImpl implements IncidentService { public void incident(CoupletMsgData coupletMsgData) { log.info("实时数据事件开始....."); RealTimeDataRequest cacheObject = redisService.getCacheObject("vin:" + coupletMsgData.getVin()); - //判断是否有缓存数据 - if (redisService.hasKey("vin:query:" + cacheObject.getVin())){ - redisService.deleteObject("vin:query:" + cacheObject.getVin()); - } +// //判断是否有缓存数据 +// if (redisService.hasKey("vin:query:" + coupletMsgData.getVin())){ +// redisService.deleteObject("vin:query:" + coupletMsgData.getVin()); +// } // if (RealTimeJudge.isJudge(coupletMsgData.getVin())) { if (coupletMsgData.getVin().equals(cacheObject.getVin())){ // log.info("有实时数据,值为:[{}]开始传输实时数据", coupletMsgData.getVin()); //判断数据是否一致, // if (RealTimeJudge.addRealTime(cacheObject)) { log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据一致,开始传输实时数据", coupletMsgData.getVin(), cacheObject); - CoupletMsgData query = incidentMapper.queryByIncident(coupletMsgData.getVin()); - redisService.setCacheObject("vin:query:" + cacheObject.getVin(), query); - redisService.expire("vin:"+cacheObject.getVin(),10, TimeUnit.MINUTES); + redisService.setCacheSet("vin:query:" + coupletMsgData.getVin(), coupletMsgData); + redisService.expire("vin:"+coupletMsgData.getVin(),10, TimeUnit.MINUTES); // } else { // log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据不一致,开始传输实时数据", coupletMsgData.getVin(), cacheObject); // } diff --git a/pom.xml b/pom.xml index 139c8c9..48aa0c2 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,8 @@ 0.9.1 8.2.2 4.1.2 + 2.8.0 + 3.0.8 2.14.3 @@ -242,7 +244,19 @@ couplet-common-event ${couplet.version} + + + org.apache.kafka + kafka-clients + ${Kafka.version} + + + org.apache.dubbo + dubbo + ${dubbo.version} + compile +