From b428b27ec6964b6216931566f8de317c0c305cc5 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期三, 22 十一月 2023 11:45:22 +0800
Subject: [PATCH] mqtt回调
---
ard-work/src/main/java/com/ruoyi/utils/qymqtt/PushCallback.java | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/utils/qymqtt/PushCallback.java b/ard-work/src/main/java/com/ruoyi/utils/qymqtt/PushCallback.java
index 465ca05..910d32f 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/qymqtt/PushCallback.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/qymqtt/PushCallback.java
@@ -46,7 +46,7 @@
@Override
public void messageArrived(String topic, MqttMessage message) throws Exception {
try {
- System.out.println("銆愯溅杈嗛攣涓婚銆戯細"+topic+"銆愯溅杈嗛攣淇℃伅銆戯細"+new String(message.getPayload(), StandardCharsets.UTF_8));
+// System.out.println("銆愯溅杈嗛攣涓婚銆戯細"+topic+"銆愯溅杈嗛攣淇℃伅銆戯細"+new String(message.getPayload(), StandardCharsets.UTF_8));
//鍑烘潵鍥炶皟鏁版嵁
List<ArdSyCarLock> ardSyCarLocks = carLockService.data(new String(message.getPayload(), StandardCharsets.UTF_8));
//鏍规嵁topic鏌ヨRTUID
@@ -96,13 +96,14 @@
System.out.println("deliveryComplete---------" + token.isComplete());
int messageId = token.getMessageId();
String[] topics = token.getTopics();
+ String clientId = token.getClient().getClientId();
// byte[] msg = token.getMessage().getPayload();
String topicStr = "";
for(String topic : topics){
topicStr = topicStr + topic + ",";
}
topicStr = topicStr.substring(0, topicStr.length() - 1);
- System.out.println("娑堟伅鍙戝竷瀹屾垚,messageId="+messageId+",topics="+topicStr);
+ System.out.println("娑堟伅鍙戝竷瀹屾垚,messageId="+messageId+",topics="+topicStr+",clientId="+clientId);
}
}
--
Gitblit v1.9.3