Compare commits

..

No commits in common. "9822f2f548dba0bd135eaa5538823f3ddaa5d322" and "395b4cc5a58812272df337b3d2d76ae0dd43d077" have entirely different histories.

8 changed files with 27 additions and 36 deletions

View File

@ -1,2 +1,5 @@
com.couplet.remote.factory.RemoteVehicleFallbackFactory
<<<<<<< HEAD
com.couplet.remote.factory.RemoteTroubleFallbackFactory
=======
>>>>>>> f07dc73 (远程调用 加自动配置扫描)

View File

@ -80,24 +80,33 @@
<groupId>com.couplet</groupId>
<artifactId>couplet-common-swagger</artifactId>
</dependency>
<!-- mqttx依赖 -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.5</version>
</dependency>
<!-- 事件核心配置 -->
<dependency>
<groupId>com.couplet</groupId>
<artifactId>couplet-common-event</artifactId>
</dependency>
<!-- Kafka依赖-->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.8.0</version>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>com.couplet</groupId>
<artifactId>couplet-common-business</artifactId>
</dependency>
<!-- RabbitMQ依赖-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
</dependencies>

View File

@ -1,7 +1,5 @@
package com.couplet.analyze.msg;
import com.couplet.analyze.msg.model.ModelsKafkaMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
@ -17,13 +15,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@EnableFeignClients(basePackages = "com.couplet")
public class CoupletMsgApplication {
public static void main(String[] args) {
SpringApplication.run(CoupletMsgApplication.class);
System.out.println("解析系统启动成功");
// new ModelsKafkaMessage().initKafkaConsumer();
}
}

View File

@ -1,6 +1,5 @@
package com.couplet.analyze.msg.model;
import com.couplet.analyze.common.event.AnalyzeEventCache;
import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.analyze.msg.service.IncidentService;
@ -11,7 +10,6 @@ import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@ -38,7 +36,7 @@ import static java.lang.Thread.sleep;
@Component
@Slf4j
public class ModelsKafkaMessage {
private static final String TOPIC_NAME = "online";
private static final String TOPIC_NAME = "fufanrui";
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";

View File

@ -41,18 +41,19 @@ public class RealTimeDataServiceImpl implements IncidentService {
public void incident(CoupletMsgData coupletMsgData) {
log.info("实时数据事件开始.....");
RealTimeDataRequest cacheObject = redisService.getCacheObject("vin:" + coupletMsgData.getVin());
// //判断是否有缓存数据
// if (redisService.hasKey("vin:query:" + coupletMsgData.getVin())){
// redisService.deleteObject("vin:query:" + coupletMsgData.getVin());
// }
//判断是否有缓存数据
if (redisService.hasKey("vin:query:" + cacheObject.getVin())){
redisService.deleteObject("vin:query:" + cacheObject.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);
redisService.setCacheSet("vin:query:" + coupletMsgData.getVin(), coupletMsgData);
redisService.expire("vin:"+coupletMsgData.getVin(),10, TimeUnit.MINUTES);
CoupletMsgData query = incidentMapper.queryByIncident(coupletMsgData.getVin());
redisService.setCacheObject("vin:query:" + cacheObject.getVin(), query);
redisService.expire("vin:"+cacheObject.getVin(),10, TimeUnit.MINUTES);
// } else {
// log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据不一致,开始传输实时数据", coupletMsgData.getVin(), cacheObject);
// }

View File

@ -23,6 +23,7 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
main:
allow-bean-definition-overriding: true
rabbitmq:
@ -48,3 +49,4 @@ logging:
mybatis-plus:
configuration:
map-underscore-to-camel-case: true

View File

@ -114,7 +114,6 @@
<groupId>com.couplet</groupId>
<artifactId>couplet-analyze-msg</artifactId>
</dependency>
</dependencies>
<build>

14
pom.xml
View File

@ -34,8 +34,6 @@
<jjwt.version>0.9.1</jjwt.version>
<minio.version>8.2.2</minio.version>
<poi.version>4.1.2</poi.version>
<Kafka.version>2.8.0</Kafka.version>
<dubbo.version>3.0.8</dubbo.version>
<transmittable-thread-local.version>2.14.3</transmittable-thread-local.version>
</properties>
@ -244,19 +242,7 @@
<artifactId>couplet-common-event</artifactId>
<version>${couplet.version}</version>
</dependency>
<!-- Kafka -->
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>${Kafka.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
</dependencyManagement>