fix: bug修复。
This commit is contained in:
@@ -48,6 +48,13 @@ public class AmqpMessageHandlerImpl implements AmqpMessageHandler {
|
|||||||
// 尝试从 topic 或 method 判断消息类型
|
// 尝试从 topic 或 method 判断消息类型
|
||||||
String topic = json.getStr("topic");
|
String topic = json.getStr("topic");
|
||||||
String method = json.getStr("method");
|
String method = json.getStr("method");
|
||||||
|
String status = json.getStr("status");
|
||||||
|
|
||||||
|
// 检查是否是设备上线/下线消息
|
||||||
|
if (status != null && ("online".equals(status) || "offline".equals(status))) {
|
||||||
|
handleLifeCycleMessage(json);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (topic != null) {
|
if (topic != null) {
|
||||||
// 根据 topic 判断消息类型
|
// 根据 topic 判断消息类型
|
||||||
@@ -60,6 +67,10 @@ public class AmqpMessageHandlerImpl implements AmqpMessageHandler {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果都没有,记录警告并跳过
|
||||||
|
log.warn("无法识别的消息格式: {}", message);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (messageType) {
|
switch (messageType) {
|
||||||
|
|||||||
Reference in New Issue
Block a user