Compare commits
10 Commits
9822f2f548
...
b293555663
Author | SHA1 | Date |
---|---|---|
|
b293555663 | |
|
0b3ed78d08 | |
|
802c97682c | |
|
bc8558576f | |
|
3fc01c4102 | |
|
36c5923bba | |
|
db23137c38 | |
|
f9ce3da77e | |
|
036db4cd79 | |
|
4101e76188 |
|
@ -17,9 +17,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -6,6 +6,7 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.ToString;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author fufanrui
|
||||
|
@ -20,7 +21,7 @@ import java.io.Serializable;
|
|||
public class RealTimeDataRequest implements Serializable {
|
||||
|
||||
|
||||
private Long userId;
|
||||
private List<Long> userId;
|
||||
|
||||
private String vin;
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.couplet.common.redis.service;
|
||||
|
||||
import ch.qos.logback.core.BasicStatusManager;
|
||||
import com.couplet.common.domain.CoupletVehicleData;
|
||||
import com.couplet.common.domain.request.RealTimeDataRequest;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.*;
|
||||
|
@ -301,8 +304,21 @@ public class RedisService {
|
|||
}
|
||||
|
||||
public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) {
|
||||
String key = "vin:" + realTimeDataRequest.getVin();
|
||||
redisTemplate.opsForSet().add(key,realTimeDataRequest);
|
||||
String key = "vin"+realTimeDataRequest.getVin();
|
||||
SetOperations setOperations = redisTemplate.opsForSet();
|
||||
// 序列化RealTimeDataRequest对象为JSON字符串
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
String jsonStr;
|
||||
try {
|
||||
jsonStr = mapper.writeValueAsString(realTimeDataRequest);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
List<String> wrappedJson = Collections.singletonList(jsonStr);
|
||||
|
||||
// 将List作为Set的唯一元素添加到Redis中
|
||||
setOperations.add(key, wrappedJson);
|
||||
}
|
||||
|
||||
public void stopViewingData(String vin) {
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -17,12 +17,10 @@ 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();
|
||||
new ModelsKafkaMessage().initKafkaConsumer();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,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 = "topic_lyh";
|
||||
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
||||
|
||||
|
||||
|
@ -52,13 +52,16 @@ public class ModelsKafkaMessage {
|
|||
private AnalyzeEventCache analyzeEventCache;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//kafka消费者初始化
|
||||
@PostConstruct
|
||||
public void initKafkaConsumer() {
|
||||
Properties props = new Properties();
|
||||
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, BOOTSTRAP_SERVERS);
|
||||
// props.put(ConsumerConfig.GROUP_ID_CONFIG, "my-consumer-group");
|
||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, "ddd");
|
||||
props.put(ConsumerConfig.GROUP_ID_CONFIG, "group");
|
||||
props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
||||
props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
|
||||
|
||||
|
@ -88,7 +91,7 @@ public class ModelsKafkaMessage {
|
|||
while (true) {
|
||||
ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100));
|
||||
records.forEach(record -> {
|
||||
System.out.println("接收到的数据:" + record.value());
|
||||
log.info("接收到的数据:" + record.value());
|
||||
String str = hexToString(record.value());
|
||||
List<CoupletMsgData> coupletMsgDataList = sendMsg(str);
|
||||
for (CoupletMsgData msgData : coupletMsgDataList) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.couplet.analyze.common.contents.AnalyzeEventContents;
|
|||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||
import com.couplet.analyze.msg.service.IncidentService;
|
||||
import com.couplet.common.core.text.Convert;
|
||||
import com.couplet.common.core.utils.StringUtils;
|
||||
import com.couplet.common.domain.Fence;
|
||||
import com.couplet.common.domain.request.FenceAndLogeRequest;
|
||||
import com.couplet.common.redis.service.RedisService;
|
||||
|
@ -46,12 +47,11 @@ public class ElectronicFenceServiceImpl implements IncidentService {
|
|||
if (redisService.hasKey(fenceKey)) {
|
||||
Set<Fence> cacheSet = redisService.getCacheSet(fenceKey);
|
||||
log.info("电子围栏事件redis存在.......");
|
||||
//jingdu;
|
||||
//longitude;
|
||||
//weidu;
|
||||
//latitude;
|
||||
for (Fence fence : cacheSet) {
|
||||
String fenceLongitudeLatitude = fence.getFenceLongitudeLatitude();
|
||||
if (!StringUtils.isEmpty(fenceLongitudeLatitude)){
|
||||
log.info("电子围栏没有数据鸭...");
|
||||
}
|
||||
/**
|
||||
* 先通过;后切割
|
||||
*/
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|||
import com.couplet.analyze.msg.mapper.IncidentMapper;
|
||||
import com.couplet.analyze.msg.service.IncidentService;
|
||||
import com.couplet.analyze.msg.service.impl.realTimeData.RealTimeJudge;
|
||||
import com.couplet.common.core.utils.StringUtils;
|
||||
import com.couplet.common.domain.request.RealTimeDataRequest;
|
||||
import com.couplet.common.redis.service.RedisService;
|
||||
import com.couplet.remote.RemoteRealTimeService;
|
||||
|
@ -12,6 +13,8 @@ import lombok.extern.log4j.Log4j2;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
@ -23,12 +26,6 @@ import java.util.concurrent.TimeUnit;
|
|||
@Log4j2
|
||||
public class RealTimeDataServiceImpl implements IncidentService {
|
||||
|
||||
/**
|
||||
* 查询传入的数据是否存在
|
||||
*/
|
||||
@Autowired
|
||||
private IncidentMapper incidentMapper;
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
|
@ -40,28 +37,16 @@ public class RealTimeDataServiceImpl implements IncidentService {
|
|||
@Override
|
||||
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 (RealTimeJudge.isJudge(coupletMsgData.getVin())) {
|
||||
if (coupletMsgData.getVin().equals(cacheObject.getVin())){
|
||||
// log.info("有实时数据,值为:[{}]开始传输实时数据", coupletMsgData.getVin());
|
||||
//判断数据是否一致,
|
||||
// if (RealTimeJudge.addRealTime(cacheObject)) {
|
||||
log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据一致,开始传输实时数据", coupletMsgData.getVin(), cacheObject);
|
||||
|
||||
if (redisService.hasKey("实时轨迹vin:"+ coupletMsgData.getVin())){
|
||||
boolean a= ("实时轨迹vin:" + coupletMsgData.getVin()).equals("实时轨迹vin:"+ coupletMsgData.getVin());
|
||||
if (a){
|
||||
log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据一致,开始传输实时数据", coupletMsgData.getVin(), coupletMsgData);
|
||||
redisService.setCacheSet("vin:query:" + coupletMsgData.getVin(), coupletMsgData);
|
||||
redisService.expire("vin:"+coupletMsgData.getVin(),10, TimeUnit.MINUTES);
|
||||
// } else {
|
||||
// log.info("[{}]有缓存数据,值为:[{}],且缓存数据与实时数据不一致,开始传输实时数据", coupletMsgData.getVin(), cacheObject);
|
||||
// }
|
||||
}
|
||||
|
||||
log.info("[{}]开始传输实时数据", coupletMsgData.getVin());
|
||||
|
||||
}
|
||||
log.info("实时数据事件结束.....");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -37,7 +37,7 @@ public class RealTimeJudge {
|
|||
userIds = new HashSet<>();
|
||||
setMap.put(realTimeDataRequest.getVin(),userIds);
|
||||
}
|
||||
userIds.add(realTimeDataRequest.getUserId());
|
||||
// userIds.add(realTimeDataRequest.getUserId());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,14 +15,17 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
rabbitmq:
|
||||
|
@ -48,3 +51,4 @@ logging:
|
|||
mybatis-plus:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
|
|
|
@ -114,7 +114,6 @@
|
|||
<groupId>com.couplet</groupId>
|
||||
<artifactId>couplet-analyze-msg</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
|
|||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients(basePackages = ("com.couplet"))
|
||||
@SpringBootApplication(scanBasePackages = {"com.couplet", "com.couplet.mq.remote"})
|
||||
@SpringBootApplication(scanBasePackages = {"com.couplet"})
|
||||
@EnableScheduling
|
||||
public class CoupletBusinessApplication {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author fufanrui
|
||||
|
@ -67,9 +68,9 @@ public class VehicleDetectionController {
|
|||
* @date
|
||||
*/
|
||||
@PostMapping("/monitorinDataList/{vin}")
|
||||
public Result<List<CoupletMsgData>> monitorinDataList(@PathVariable String vin){
|
||||
List<CoupletMsgData> monitorinDataList = vehicleDetectionService.monitorinDataList(vin);
|
||||
Result<List<CoupletMsgData>> success = Result.success(monitorinDataList);
|
||||
public Result<Set<CoupletMsgData>> monitorinDataList(@PathVariable String vin){
|
||||
Set<CoupletMsgData> monitorinDataList = vehicleDetectionService.monitorinDataList(vin);
|
||||
Result<Set<CoupletMsgData>> success = Result.success(monitorinDataList);
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.couplet.common.domain.CoupletVehicleData;
|
|||
import com.couplet.common.domain.Vehicle;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public interface VehicleDetectionService {
|
||||
|
||||
|
@ -13,7 +14,9 @@ public interface VehicleDetectionService {
|
|||
|
||||
void stopViewingData(String vin);
|
||||
|
||||
List<CoupletMsgData> monitorinDataList(String vin);
|
||||
|
||||
|
||||
void monitorinData(String vin);
|
||||
|
||||
Set<CoupletMsgData> monitorinDataList(String vin);
|
||||
}
|
||||
|
|
|
@ -44,12 +44,12 @@ public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements
|
|||
*/
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
|
||||
/**
|
||||
* 远程调用队列服务
|
||||
*/
|
||||
// @Autowired
|
||||
// private RemoteFenceService remoteFenceService;
|
||||
|
||||
@Override
|
||||
public List<Fence> pageQuery(FenceConfig fenceConfig) {
|
||||
List<Fence> list = fenceMapper.pageQuery(fenceConfig);
|
||||
|
@ -70,36 +70,26 @@ public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements
|
|||
// remoteFenceService.fenceQueue(fenceUpdateRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fenceInsert(FenceRequest fenceRequest) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务实现:添加围栏
|
||||
*
|
||||
* @param request
|
||||
* @param
|
||||
* @param fenceRequest
|
||||
*/
|
||||
// @Override
|
||||
// public void fenceInsert(HttpServletRequest request, FenceRequest fenceRequest) {
|
||||
// String username = SecurityUtils.getUsername();
|
||||
// fenceRequest.setCrateName(username);
|
||||
// //先添加围栏
|
||||
// fenceMapper.insertFence(fenceRequest);
|
||||
// String[] logoIds = fenceRequest.getLogoIds();
|
||||
// String[] parts = new String[0];
|
||||
// for (String logoId : logoIds) {
|
||||
// //把前台传入的字符串分割成数组
|
||||
// parts = logoId.split(",");
|
||||
// //再添加围栏和标识中间表
|
||||
// fenAndLogoService.addBach(fenceRequest.getFenceId(), parts);
|
||||
// }
|
||||
// /**
|
||||
// * 电子围栏发送改变
|
||||
// */
|
||||
// redisTemplate.opsForValue().set("fenceInsert", JSON.toJSONString(fenceRequest), 10, TimeUnit.MINUTES);
|
||||
// }
|
||||
@Override
|
||||
public void fenceInsert(FenceRequest fenceRequest) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
fenceRequest.setCrateName(username);
|
||||
fenceRequest.setMaintainerName(username);
|
||||
//先添加围栏
|
||||
fenceMapper.insertFence(fenceRequest);
|
||||
|
||||
fenAndLogoService.addBach(fenceRequest.getFenceId(), fenceRequest.getLogoIds());
|
||||
/**
|
||||
* 电子围栏发送改变
|
||||
*/
|
||||
redisTemplate.opsForValue().set("fenceInsert", JSON.toJSONString(fenceRequest), 10, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeByFenceId(Long fenceId) {
|
||||
|
|
|
@ -22,10 +22,7 @@ import org.springframework.stereotype.Service;
|
|||
import springfox.documentation.spring.web.json.Json;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
@ -53,23 +50,29 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<CoupletMsgData> monitorinDataList(String vin) {
|
||||
public Set<CoupletMsgData> monitorinDataList(String vin) {
|
||||
String key = "vin:query:" + vin;
|
||||
log.info("key为:"+key);
|
||||
Set<CoupletMsgData> cacheSet = redisService.getCacheSet(key);
|
||||
ArrayList<CoupletMsgData> coupletMsgData = new ArrayList<>(cacheSet);
|
||||
return coupletMsgData;
|
||||
|
||||
return cacheSet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void monitorinData(String vin) {
|
||||
//创建对象
|
||||
RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest();
|
||||
//获取用户id
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
//设置车辆vin
|
||||
realTimeDataRequest.setVin(vin);
|
||||
realTimeDataRequest.setUserId(userId);
|
||||
// analyzeEventCache.queryEvent("查询实时数据"+vin,realTimeDataRequest);
|
||||
// redisService.expire("查询实时数据"+vin,4,TimeUnit.MINUTES);
|
||||
redisService.setVinAndUserId(realTimeDataRequest);
|
||||
//创建hashSet集合
|
||||
HashSet<Long> objects = new HashSet<>();
|
||||
//添加车辆id
|
||||
objects.add(userId);
|
||||
//把对象放入hashSet集合中
|
||||
//存储的对象是:key:业务+vin value: hashSet集合类型的对象
|
||||
redisService.setCacheSet("实时轨迹vin:"+ vin,objects);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -423,11 +423,12 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
|||
bindLogoById.forEach(logoId -> {
|
||||
|
||||
//存标识id 的set
|
||||
HashSet<Long> logos = new HashSet<>();
|
||||
logos.add(logoId);
|
||||
//存入redis
|
||||
redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos);
|
||||
redis.expire("车辆vin和标识:" + vehicle.getVin(), 2, TimeUnit.MINUTES);
|
||||
// HashSet<Long> logos = new HashSet<>();
|
||||
// logos.add(logoId);
|
||||
// //存入redis
|
||||
// redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos);
|
||||
|
||||
// redis.expire("车辆vin和标识:" + vehicle.getVin(), 5, TimeUnit.MINUTES);
|
||||
|
||||
|
||||
//通过标识id获取标识绑定的电子围栏集合
|
||||
|
@ -438,7 +439,7 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
|||
fanceSet.add(fence);
|
||||
//存入redis
|
||||
redis.setCacheSet("车辆vin和电子围栏:" + vehicle.getVin(), fanceSet);
|
||||
redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 2, TimeUnit.MINUTES);
|
||||
// redis.expire("车辆vin和电子围栏:" + vehicle.getVin(), 5, TimeUnit.MINUTES);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -16,11 +16,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -60,8 +60,7 @@
|
|||
INSERT INTO `couplet-cloud`.`couplet_fence_info`
|
||||
(`fence_name`,`fence_longitude_latitude`, `fence_description`, `is_delete`, `fence_state`, `create_time`,
|
||||
`update_time`, `create_name`, `maintainer_name`, `alarm_status`, `fence_condition`)
|
||||
VALUES
|
||||
(#{fenceName}, null, #{fenceDescription}, 0, 0, now(), null, null, #{maintainerName}, 0 ,0)
|
||||
VALUES (#{fenceName}, NULL, #{fenceDescription} , 0, 0, now(), NULL, #{crateName}, #{maintainerName}, 0, 1)
|
||||
|
||||
|
||||
</insert>
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -17,9 +17,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -74,7 +74,7 @@ public class MqController {
|
|||
RealTimeDataRequest realTimeDataRequest = new RealTimeDataRequest();
|
||||
realTimeDataRequest.setVin(vin);
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
realTimeDataRequest.setUserId(userId);
|
||||
|
||||
rabbitTemplate.convertAndSend(RabbitMQConfig.VinExchangeName, RabbitMQConfig.VinRoutingKey, realTimeDataRequest,
|
||||
message -> {
|
||||
message.getMessageProperties().setMessageId(IdUtils.randomUUID());
|
||||
|
|
|
@ -15,9 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -76,7 +76,7 @@ public class MqttMonitor {
|
|||
|
||||
|
||||
//Kafka生产者配置
|
||||
private static final String TOPIC_NAME = "fufanrui";
|
||||
private static final String TOPIC_NAME = "topic_lhy";
|
||||
private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092";
|
||||
|
||||
//线程池,用于异步处理消息到来时的业务逻辑
|
||||
|
|
|
@ -36,7 +36,7 @@ mqtt:
|
|||
# broker: mqtt://115.159.47.13:1883
|
||||
username:
|
||||
password:
|
||||
clientId: fufanrui44
|
||||
clientId: aaaaaad
|
||||
qos: 0
|
||||
topic: test898
|
||||
topic: xiaoYao
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -15,11 +15,11 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 121.89.211.230:8848
|
||||
namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4
|
||||
namespace: 172469
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue