diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml b/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml
index 9d3ca6b..715187a 100644
--- a/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml
+++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/pom.xml
@@ -92,7 +92,6 @@
org.springframework.boot
spring-boot-starter-amqp
-
diff --git a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java
index 0d04fa8..201ff2a 100644
--- a/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java
+++ b/couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.java
@@ -4,6 +4,7 @@ import com.couplet.analyze.msg.domain.CoupletMsgData;
import com.couplet.analyze.msg.service.CoupletMsgService;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.*;
+import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -13,6 +14,7 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -34,6 +36,9 @@ public class ModelMessage {
@Autowired
private CoupletMsgService coupletMsgService;
+ @Autowired
+ private RabbitTemplate rabbitTemplate;
+
@Autowired
public ModelMessage(CoupletMsgService coupletMsgService){
this.coupletMsgService = coupletMsgService;
@@ -64,6 +69,11 @@ public class ModelMessage {
for (CoupletMsgData msgData : coupletMsgDataList) {
log.info("解析到车辆数据:{}", msgData);
+ //发送日志到MQ
+ rabbitTemplate.convertAndSend("couplet-log-queue",msgData,message -> {
+ message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
+ return message;
+ });
}
}
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 f690aa8..4156d2e 100644
--- a/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml
+++ b/couplet-modules/couplet-modules-onLine/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
# Tomcat
server:
- port: 9616
+ port: 9617
# Spring
spring: