diff --git a/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java b/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java index 1dc7bb4..35926ee 100644 --- a/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java +++ b/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java @@ -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 userId; private String vin; diff --git a/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/contents/AnalyzeEventContents.java b/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/contents/AnalyzeEventContents.java index 7e76640..73c9c97 100644 --- a/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/contents/AnalyzeEventContents.java +++ b/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/contents/AnalyzeEventContents.java @@ -10,21 +10,12 @@ import org.springframework.stereotype.Component; */ public interface AnalyzeEventContents { - /** - * 故障 - */ + //故障 static final String BREAKDOWN = "breakdown"; - /** - * 电子围栏 - */ - static final String ELECTRONIC_FENCE = "electronic-fence"; - /** - * 实时数据 - */ - static final String REAL_TIME_DATA = "real-time-data"; - - /** - * 存储 - */ - static final String STORED_EVENT = "stored-event"; + //电子围栏 + static final String ELECTRONIC_FENCE = "electronic_fence"; + //实时数据 + static final String REAL_TIME_DATA = "real_time_data"; + //存储 + static final String STORED_EVENT = "stored_event"; } diff --git a/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/event/AnalyzeEventCache.java b/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/event/AnalyzeEventCache.java index b5dba7e..d3490d3 100644 --- a/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/event/AnalyzeEventCache.java +++ b/couplet-common/couplet-common-event/src/main/java/com/couplet/analyze/common/event/AnalyzeEventCache.java @@ -3,6 +3,7 @@ package com.couplet.analyze.common.event; import com.couplet.common.domain.request.RealTimeDataRequest; import com.couplet.common.redis.service.RedisService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; import java.util.Set; @@ -12,6 +13,7 @@ import java.util.Set; * @Description: */ +@Component public class AnalyzeEventCache { @Autowired diff --git a/couplet-common/couplet-common-redis/pom.xml b/couplet-common/couplet-common-redis/pom.xml index 6fb7805..617dffc 100644 --- a/couplet-common/couplet-common-redis/pom.xml +++ b/couplet-common/couplet-common-redis/pom.xml @@ -33,5 +33,6 @@ couplet-common-business + diff --git a/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java b/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java index ec07e06..3b6e681 100644 --- a/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java +++ b/couplet-common/couplet-common-redis/src/main/java/com/couplet/common/redis/service/RedisService.java @@ -23,17 +23,13 @@ public class RedisService { public RedisTemplate redisTemplate; - public List getList () { - return redisTemplate.opsForList().range("coupletMsgData", 0, -1); - } - // ... 其他已有方法 ... /** * 向指定集合中添加值,如果值不存在则添加并返回true,否则返回false。 * * @param setKey 集合键名 - * @param value 要添加的值 + * @param value 要添加的值 * @return true表示值已成功添加(之前不存在),false表示值已存在 */ public boolean addToSetIfNotExists(String setKey, String value) { @@ -47,7 +43,7 @@ public class RedisService { * @param key 缓存的键值 * @param value 缓存的值 */ - public void setCacheObject (final String key, final T value) { + public void setCacheObject(final String key, final T value) { redisTemplate.opsForValue().set(key, value); } @@ -59,7 +55,7 @@ public class RedisService { * @param timeout 时间 * @param timeUnit 时间颗粒度 */ - public void setCacheObject (final String key, final T value, final Long timeout, final TimeUnit timeUnit) { + public void setCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit) { redisTemplate.opsForValue().set(key, value, timeout, timeUnit); } @@ -68,10 +64,9 @@ public class RedisService { * * @param key Redis键 * @param timeout 超时时间 - * * @return true=设置成功;false=设置失败 */ - public boolean expire (final String key, final long timeout) { + public boolean expire(final String key, final long timeout) { return expire(key, timeout, TimeUnit.SECONDS); } @@ -81,10 +76,9 @@ public class RedisService { * @param key Redis键 * @param timeout 超时时间 * @param unit 时间单位 - * * @return true=设置成功;false=设置失败 */ - public boolean expire (final String key, final long timeout, final TimeUnit unit) { + public boolean expire(final String key, final long timeout, final TimeUnit unit) { return redisTemplate.expire(key, timeout, unit); } @@ -92,10 +86,9 @@ public class RedisService { * 获取有效时间 * * @param key Redis键 - * * @return 有效时间 */ - public long getExpire (final String key) { + public long getExpire(final String key) { return redisTemplate.getExpire(key); } @@ -103,10 +96,9 @@ public class RedisService { * 判断 key是否存在 * * @param key 键 - * * @return true 存在 false不存在 */ - public Boolean hasKey (String key) { + public Boolean hasKey(String key) { return redisTemplate.hasKey(key); } @@ -114,10 +106,9 @@ public class RedisService { * 获得缓存的基本对象。 * * @param key 缓存键值 - * * @return 缓存键值对应的数据 */ - public T getCacheObject (final String key) { + public T getCacheObject(final String key) { ValueOperations operation = redisTemplate.opsForValue(); return operation.get(key); } @@ -127,7 +118,7 @@ public class RedisService { * * @param key */ - public boolean deleteObject (final String key) { + public boolean deleteObject(final String key) { return redisTemplate.delete(key); } @@ -135,10 +126,9 @@ public class RedisService { * 删除集合对象 * * @param collection 多个对象 - * * @return */ - public boolean deleteObject (final Collection collection) { + public boolean deleteObject(final Collection collection) { return redisTemplate.delete(collection) > 0; } @@ -147,10 +137,9 @@ public class RedisService { * * @param key 缓存的键值 * @param dataList 待缓存的List数据 - * * @return 缓存的对象 */ - public long setCacheList (final String key, final List dataList) { + public long setCacheList(final String key, final List dataList) { Long count = redisTemplate.opsForList().rightPushAll(key, dataList); return count == null ? 0 : count; } @@ -159,10 +148,9 @@ public class RedisService { * 获得缓存的list对象 * * @param key 缓存的键值 - * * @return 缓存键值对应的数据 */ - public List getCacheList (final String key) { + public List getCacheList(final String key) { return redisTemplate.opsForList().range(key, 0, -1); } @@ -171,10 +159,9 @@ public class RedisService { * * @param key 缓存键值 * @param dataSet 缓存的数据 - * * @return 缓存数据的对象 */ - public BoundSetOperations setCacheSet (final String key, final Set dataSet) { + public BoundSetOperations setCacheSet(final String key, final Set dataSet) { BoundSetOperations setOperation = redisTemplate.boundSetOps(key); Iterator it = dataSet.iterator(); while (it.hasNext()) { @@ -182,25 +169,25 @@ public class RedisService { } return setOperation; } + /** * 缓存Set * - * @param key 缓存键值 + * @param key 缓存键值 * @param setValue 缓存的数据 - * * @return 缓存数据的对象 */ - public BoundSetOperations setCacheSet (final String key, final T setValue) { + public BoundSetOperations setCacheSet(final String key, final T setValue) { BoundSetOperations setOperation = redisTemplate.boundSetOps(key); setOperation.add(setValue); return setOperation; } + /** * 缓存Set * - * @param key 缓存键值 + * @param key 缓存键值 * @param setValue 缓存的数据 - * * @return 缓存数据的对象 */ public void deleteSet(String key, String setValue) { @@ -208,26 +195,25 @@ public class RedisService { BoundSetOperations setOperations = redisTemplate.boundSetOps(key); setOperations.remove(setValue); } + /** * 获得缓存的set * * @param key - * * @return */ - public Set getCacheSet (final String key) { + public Set getCacheSet(final String key) { return redisTemplate.opsForSet().members(key); } - /** * 缓存Map * * @param key * @param dataMap */ - public void setCacheMap (final String key, final Map dataMap) { + public void setCacheMap(final String key, final Map dataMap) { if (dataMap != null) { redisTemplate.opsForHash().putAll(key, dataMap); } @@ -237,10 +223,9 @@ public class RedisService { * 获得缓存的Map * * @param key - * * @return */ - public Map getCacheMap (final String key) { + public Map getCacheMap(final String key) { return redisTemplate.opsForHash().entries(key); } @@ -251,7 +236,7 @@ public class RedisService { * @param hKey Hash键 * @param value 值 */ - public void setCacheMapValue (final String key, final String hKey, final T value) { + public void setCacheMapValue(final String key, final String hKey, final T value) { redisTemplate.opsForHash().put(key, hKey, value); } @@ -260,10 +245,9 @@ public class RedisService { * * @param key Redis键 * @param hKey Hash键 - * * @return Hash中的对象 */ - public T getCacheMapValue (final String key, final String hKey) { + public T getCacheMapValue(final String key, final String hKey) { HashOperations opsForHash = redisTemplate.opsForHash(); return opsForHash.get(key, hKey); } @@ -273,10 +257,9 @@ public class RedisService { * * @param key Redis键 * @param hKeys Hash键集合 - * * @return Hash对象集合 */ - public List getMultiCacheMapValue (final String key, final Collection hKeys) { + public List getMultiCacheMapValue(final String key, final Collection hKeys) { return redisTemplate.opsForHash().multiGet(key, hKeys); } @@ -285,10 +268,9 @@ public class RedisService { * * @param key Redis键 * @param hKey Hash键 - * * @return 是否成功 */ - public boolean deleteCacheMapValue (final String key, final String hKey) { + public boolean deleteCacheMapValue(final String key, final String hKey) { return redisTemplate.opsForHash().delete(key, hKey) > 0; } @@ -296,21 +278,20 @@ public class RedisService { * 获得缓存的基本对象列表 * * @param pattern 字符串前缀 - * * @return 对象列表 */ - public Collection keys (final String pattern) { + public Collection keys(final String pattern) { return redisTemplate.keys(pattern); } public void setVinAndUserId(RealTimeDataRequest realTimeDataRequest) { - String key = "vin:"+realTimeDataRequest.getVin(); - redisTemplate.opsForValue().set(key, realTimeDataRequest); + String key = "vin:" + realTimeDataRequest.getVin(); + redisTemplate.opsForSet().add(key, realTimeDataRequest); } public void stopViewingData(String vin) { - - String key = "vin:"+vin; + String key = "vin:" + vin; redisTemplate.delete(key); } + } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/CoupletMsgApplication.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/CoupletMsgApplication.java index 0cf32fb..11b3509 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/CoupletMsgApplication.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/CoupletMsgApplication.java @@ -15,14 +15,12 @@ import org.springframework.scheduling.annotation.EnableScheduling; */ @SpringBootApplication(scanBasePackages = "com.couplet") @EnableScheduling -@EnableFeignClients(basePackages = "com.couplet.**") +@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(); } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java index 89b30ee..860a3c5 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelsKafkaMessage.java @@ -11,6 +11,8 @@ 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; import javax.annotation.PostConstruct; @@ -26,6 +28,7 @@ import static com.couplet.analyze.msg.utils.MsgUtils.hexToString; import static com.couplet.analyze.msg.utils.MsgUtils.sendMsg; import static java.lang.Thread.sleep; + /** * @author DongXiaoDong * @version 1.0 @@ -35,7 +38,7 @@ import static java.lang.Thread.sleep; @Component @Slf4j public class ModelsKafkaMessage { - private static final String TOPIC_NAME = "dong"; + private static final String TOPIC_NAME = "topic_lyh"; private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092"; @@ -55,7 +58,7 @@ public class ModelsKafkaMessage { 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"); @@ -102,12 +105,6 @@ public class ModelsKafkaMessage { // message.getMessageProperties().setMessageId(UUID.randomUUID().toString()); // return message; // }); - - try { - sleep(100); - } catch (Exception e) { - throw new VehicleException("睡眠失败" + e); - } } }); } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java index 88e6fa3..f754efb 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/BreakdownServiceImpl.java @@ -1,6 +1,7 @@ package com.couplet.analyze.msg.service.impl; import com.alibaba.fastjson.JSON; +import com.couplet.analyze.common.contents.AnalyzeEventContents; import com.couplet.analyze.msg.contents.StateConstant; import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.analyze.msg.service.IncidentService; @@ -26,7 +27,7 @@ import java.util.concurrent.TimeUnit; * @Date: 2024/4/2 * @Description: 故障事件 */ -@Service("breakdown") +@Service(AnalyzeEventContents.BREAKDOWN) public class BreakdownServiceImpl extends KeyExpirationEventMessageListener implements IncidentService { /** @@ -93,7 +94,7 @@ public class BreakdownServiceImpl extends KeyExpirationEventMessageListener impl */ @Override public String getName() { - return "breakdown"; + return AnalyzeEventContents.BREAKDOWN; } public void scheduledRedis() { diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/ElectronicFenceServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/ElectronicFenceServiceImpl.java index 63a232c..f06e875 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/ElectronicFenceServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/ElectronicFenceServiceImpl.java @@ -1,9 +1,11 @@ package com.couplet.analyze.msg.service.impl; import com.alibaba.fastjson.JSON; +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; @@ -22,7 +24,7 @@ import java.util.Set; * @Date: 2024/4/2 * @Description: 电子围栏事件服务实现类 */ -@Service("electronic_fence") +@Service(AnalyzeEventContents.ELECTRONIC_FENCE) @Log4j2 public class ElectronicFenceServiceImpl implements IncidentService { @@ -45,12 +47,11 @@ public class ElectronicFenceServiceImpl implements IncidentService { if (redisService.hasKey(fenceKey)) { Set 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("电子围栏没有数据鸭..."); + } /** * 先通过;后切割 */ @@ -86,7 +87,7 @@ public class ElectronicFenceServiceImpl implements IncidentService { */ @Override public String getName() { - return "electronic-fence"; + return AnalyzeEventContents.ELECTRONIC_FENCE; } 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 daf4aec..6672e42 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 @@ -1,9 +1,11 @@ package com.couplet.analyze.msg.service.impl; +import com.couplet.analyze.common.contents.AnalyzeEventContents; 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; @@ -11,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; /** @@ -18,16 +22,10 @@ import java.util.concurrent.TimeUnit; * @Date: 2024/4/2 * @Description: 实时数据事件 */ -@Service("real_time_data") +@Service(AnalyzeEventContents.REAL_TIME_DATA) @Log4j2 public class RealTimeDataServiceImpl implements IncidentService { - /** - * 查询传入的数据是否存在 - */ - @Autowired - private IncidentMapper incidentMapper; - @Autowired private RedisService redisService; @@ -38,28 +36,17 @@ public class RealTimeDataServiceImpl implements IncidentService { */ @Override public void incident(CoupletMsgData coupletMsgData) { - log.info("实时数据事件开始....."); - RealTimeDataRequest cacheObject = redisService.getCacheObject("vin:" + coupletMsgData.getVin()); - //判断是否有缓存数据 - if (RealTimeJudge.isJudge(coupletMsgData.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); - } else { - 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); + } } - - log.info("[{}]开始传输实时数据", coupletMsgData.getVin()); - log.info("实时数据事件结束....."); - } /** @@ -69,6 +56,6 @@ public class RealTimeDataServiceImpl implements IncidentService { */ @Override public String getName() { - return "real-time-data"; + return AnalyzeEventContents.REAL_TIME_DATA; } } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/StoredEventServiceImpl.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/StoredEventServiceImpl.java index f7504b8..852edfb 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/StoredEventServiceImpl.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/StoredEventServiceImpl.java @@ -1,5 +1,6 @@ package com.couplet.analyze.msg.service.impl; +import com.couplet.analyze.common.contents.AnalyzeEventContents; import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.analyze.msg.mapper.IncidentMapper; import com.couplet.analyze.msg.service.IncidentService; @@ -12,7 +13,7 @@ import org.springframework.stereotype.Service; * @Date: 2024/4/2 * @Description: 事件存储服务 */ -@Service("stored_event") +@Service(AnalyzeEventContents.STORED_EVENT) @Log4j2 public class StoredEventServiceImpl implements IncidentService { @Autowired @@ -36,6 +37,6 @@ public class StoredEventServiceImpl implements IncidentService { */ @Override public String getName() { - return "stored-event"; + return AnalyzeEventContents.STORED_EVENT; } } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/realTimeData/RealTimeJudge.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/realTimeData/RealTimeJudge.java index af9dba3..d7d35e0 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/realTimeData/RealTimeJudge.java +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/service/impl/realTimeData/RealTimeJudge.java @@ -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; } diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml index e506271..2143241 100644 --- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/resources/bootstrap.yml @@ -15,16 +15,17 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 shared-configs: - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} + main: allow-bean-definition-overriding: true rabbitmq: @@ -50,3 +51,4 @@ logging: mybatis-plus: configuration: map-underscore-to-camel-case: true + diff --git a/couplet-modules/couplet-business/pom.xml b/couplet-modules/couplet-business/pom.xml index 25956ae..cc83ffe 100644 --- a/couplet-modules/couplet-business/pom.xml +++ b/couplet-modules/couplet-business/pom.xml @@ -87,6 +87,11 @@ spring-boot-starter-amqp + + com.couplet + couplet-common-event + + org.springframework.boot @@ -105,6 +110,10 @@ com.couplet couplet-common-event + + com.couplet + couplet-analyze-msg + diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java index 2ef9e84..4333fca 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/CoupletBusinessApplication.java @@ -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) { diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java index 15894bd..cf1919a 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java @@ -1,5 +1,6 @@ package com.couplet.business.server.controller; +import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.business.server.service.VehicleDetectionService; import com.couplet.common.core.domain.Result; import com.couplet.common.domain.CoupletVehicleData; @@ -58,21 +59,21 @@ public class VehicleDetectionController { public void monitorinData(@PathVariable String vin){ vehicleDetectionService.monitorinData(vin); } - /* * @param : - * @return Result> + * @return Result> * @author 付凡芮 * @description 查看事实数据列表 * @date */ - @PostMapping("realData") - public Result> realData(){ - List list = redisService.getList(); - Result> success = Result.success(list); + @PostMapping("/monitorinDataList/{vin}") + public Result> monitorinDataList(@PathVariable String vin){ + List monitorinDataList = vehicleDetectionService.monitorinDataList(vin); + Result> success = Result.success(monitorinDataList); return success; } + /* * @param vin: * @return void diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java index 9537c17..f894f8b 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java @@ -1,6 +1,8 @@ package com.couplet.business.server.service; +import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.common.core.domain.Result; +import com.couplet.common.domain.CoupletVehicleData; import com.couplet.common.domain.Vehicle; import java.util.List; @@ -9,8 +11,9 @@ public interface VehicleDetectionService { List detectionList(); - void monitorinData(String vin); - - void stopViewingData(String vin); + + List monitorinDataList(String vin); + + void monitorinData(String vin); } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java index d2b8f08..0e9e5b4 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/FenceServiceImpl.java @@ -44,12 +44,12 @@ public class FenceServiceImpl extends ServiceImpl implements */ @Autowired private StringRedisTemplate redisTemplate; + /** * 远程调用队列服务 */ // @Autowired // private RemoteFenceService remoteFenceService; - @Override public List pageQuery(FenceConfig fenceConfig) { List list = fenceMapper.pageQuery(fenceConfig); @@ -70,36 +70,26 @@ public class FenceServiceImpl extends ServiceImpl 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) { diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java index 06f1bb6..b3686cf 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java @@ -2,11 +2,13 @@ package com.couplet.business.server.service.impl; import afu.org.checkerframework.checker.units.qual.A; import com.alibaba.fastjson.JSON; +import com.couplet.analyze.msg.domain.CoupletMsgData; import com.couplet.analyze.common.event.AnalyzeEventCache; import com.couplet.business.server.mapper.VehicleDetectionMapper; import com.couplet.business.server.service.VehicleDetectionService; import com.couplet.business.server.service.VehicleManageService; import com.couplet.common.core.domain.Result; +import com.couplet.common.domain.CoupletVehicleData; import com.couplet.common.domain.Vehicle; import com.couplet.common.domain.request.RealTimeDataRequest; import com.couplet.common.redis.service.RedisService; @@ -14,11 +16,13 @@ import com.couplet.common.security.utils.SecurityUtils; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.mysql.cj.xdevapi.JsonString; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import springfox.documentation.spring.web.json.Json; -import java.util.List; +import java.lang.reflect.Array; +import java.util.*; import java.util.concurrent.TimeUnit; /** @@ -28,6 +32,7 @@ import java.util.concurrent.TimeUnit; * @date 2024/4/4 10:23 */ @Service +@Slf4j public class VehicleDetectionServiceImpl implements VehicleDetectionService{ @Autowired @@ -44,15 +49,30 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{ return vehicles; } + @Override + public List monitorinDataList(String vin) { + String key = "vin:query:" + vin; + log.info("key为:"+key); + Set cacheSet = redisService.getCacheSet(key); + ArrayList coupletMsgData = new ArrayList<>(cacheSet); + return coupletMsgData; + } + @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 objects = new HashSet<>(); + //添加车辆id + objects.add(userId); + //把对象放入hashSet集合中 + //存储的对象是:key:业务+vin value: hashSet集合类型的对象 + redisService.setCacheSet("实时轨迹vin:"+ vin,objects); } @Override @@ -60,4 +80,5 @@ public class VehicleDetectionServiceImpl implements VehicleDetectionService{ redisService.stopViewingData(vin); } + } diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java index 6c22945..952b9d1 100644 --- a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleServiceImpl.java @@ -3,6 +3,8 @@ package com.couplet.business.server.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.couplet.analyze.common.contents.AnalyzeEventContents; +import com.couplet.analyze.common.event.AnalyzeEventCache; import com.couplet.business.server.mapper.VehicleMapper; import com.couplet.business.server.service.FenAndLogoService; import com.couplet.business.server.service.VehicleAndLogoService; @@ -24,6 +26,7 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.PostConstruct; import java.util.HashSet; import java.util.List; import java.util.concurrent.TimeUnit; @@ -59,6 +62,9 @@ public class VehicleServiceImpl extends ServiceImpl impl @Autowired private FenAndLogoService fenAndLogoService; + @Autowired + private AnalyzeEventCache eventCache; + /* * @Author: LiuYunHu * @Date: 2024/3/26 22:11 @@ -254,6 +260,7 @@ public class VehicleServiceImpl extends ServiceImpl impl Result.error(result); } + //获取新增的车辆id值 //执行添加电子围栏 int i = vehicleAndLogoService.vehicleBindLogo(vehicle.getVehicleId(), insertParams.getLogoIds()); @@ -262,6 +269,9 @@ public class VehicleServiceImpl extends ServiceImpl impl //刷新set缓存 reCache(); + //加入事件缓存 + reEvent(); + result = "新增成功!"; @@ -395,7 +405,10 @@ public class VehicleServiceImpl extends ServiceImpl impl * @Param: [] * @Return: void **/ - @Scheduled(cron = "0/3 * * * * *") +// @Scheduled(cron = "0/3 * * * * *") + + //初始化 + @PostConstruct public void reCache() { //刷新缓存执行开始 @@ -410,11 +423,12 @@ public class VehicleServiceImpl extends ServiceImpl impl bindLogoById.forEach(logoId -> { //存标识id 的set - HashSet logos = new HashSet<>(); - logos.add(logoId); - //存入redis - redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos); - redis.expire("车辆vin和标识:" + vehicle.getVin(), 2, TimeUnit.MINUTES); +// HashSet logos = new HashSet<>(); +// logos.add(logoId); +// //存入redis +// redis.setCacheSet("车辆vin和标识:" + vehicle.getVin(), logos); + +// redis.expire("车辆vin和标识:" + vehicle.getVin(), 5, TimeUnit.MINUTES); //通过标识id获取标识绑定的电子围栏集合 @@ -425,10 +439,29 @@ public class VehicleServiceImpl extends ServiceImpl 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); }); }); }); } + + /* + * @Author: LiuYunHu + * @Date: 2024/4/8 19:39 + * @Description: 初始化 车辆事件 默认车辆有所有事件 + * @Param: [] + * @Return: void + **/ + @PostConstruct + public void reEvent() { + List list = list(new VehicleListParams()); + + list.forEach(vehicle -> { + eventCache.addEvent(vehicle.getVin(), AnalyzeEventContents.STORED_EVENT); + eventCache.addEvent(vehicle.getVin(), AnalyzeEventContents.BREAKDOWN); + eventCache.addEvent(vehicle.getVin(), AnalyzeEventContents.ELECTRONIC_FENCE); + eventCache.addEvent(vehicle.getVin(), AnalyzeEventContents.REAL_TIME_DATA); + }); + } } diff --git a/couplet-modules/couplet-business/src/main/resources/bootstrap.yml b/couplet-modules/couplet-business/src/main/resources/bootstrap.yml index 6c75304..b88e464 100644 --- a/couplet-modules/couplet-business/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-business/src/main/resources/bootstrap.yml @@ -16,11 +16,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-business/src/main/resources/mapper/business/FenceMapper.xml b/couplet-modules/couplet-business/src/main/resources/mapper/business/FenceMapper.xml index 1c434a4..b4311c0 100644 --- a/couplet-modules/couplet-business/src/main/resources/mapper/business/FenceMapper.xml +++ b/couplet-modules/couplet-business/src/main/resources/mapper/business/FenceMapper.xml @@ -57,11 +57,10 @@ - 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) + 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, #{crateName}, #{maintainerName}, 0, 1) diff --git a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml index be8cc08..b0d1d24 100644 --- a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml index aa5cec6..d2113ff 100644 --- a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml index 2bfb6f5..41d1fef 100644 --- a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/controller/MqController.java b/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/controller/MqController.java index f1921d2..3ffbce2 100644 --- a/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/controller/MqController.java +++ b/couplet-modules/couplet-modules-mq/src/main/java/com/couplet/mq/controller/MqController.java @@ -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()); diff --git a/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml b/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml index 5ed380f..1de6dd7 100644 --- a/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-modules-mq/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 @@ -48,6 +48,7 @@ logging: # RabbitMQ配置 mq: queueName: queue + VinQueueName: vinQueueName exchangeName: exchange routingKey: routingKey diff --git a/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java b/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java index 68ac0dd..f908473 100644 --- a/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java +++ b/couplet-modules/couplet-modules-onLine/src/main/java/com/couplet/online/utils/MqttMonitor.java @@ -76,7 +76,7 @@ public class MqttMonitor { //Kafka生产者配置 - private static final String TOPIC_NAME = "dong"; + private static final String TOPIC_NAME = "topic_lhy"; private static final String BOOTSTRAP_SERVERS = "39.103.133.136:9092"; //线程池,用于异步处理消息到来时的业务逻辑 diff --git a/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml b/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml index d7abfa2..b66436a 100644 --- a/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml @@ -15,11 +15,9 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 # 配置文件格式 file-extension: yml # 共享配置 @@ -34,11 +32,11 @@ logging: # 订阅端配置 mqtt: server: -# broker: tcp://115.159.47.13:1883 - broker: tcp://8.130.181.16:1883 + broker: tcp://115.159.47.13:1883 + # broker: mqtt://115.159.47.13:1883 username: password: - clientId: aaa + clientId: aaaaaad qos: 0 - topic: dxd + topic: xiaoYao diff --git a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml index c3d342c..91453d0 100644 --- a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml index 9d73f5a..d219500 100644 --- a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml +++ b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15 + namespace: 172469 # 配置文件格式 file-extension: yml # 共享配置 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 +