fix(iot): 修复JT808业务消息重复应答问题
- 在 handleBusinessMessage 中设置 message.setCode(0) 标记协议层已应答 - 避免业务层重复发送 reply 消息 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -113,7 +113,11 @@ public class Jt808ProtocolHandler extends AbstractProtocolHandler {
|
||||
String codecType, NetSocket socket,
|
||||
String productKey, String deviceName, String serverId) {
|
||||
try {
|
||||
// 1. 发送消息到消息总线
|
||||
// 1. 标记消息为"协议层已应答",业务层无需再发送 reply
|
||||
// 设置 code = 0 后,isReplyMessage() 返回 true,业务层跳过 reply
|
||||
message.setCode(0);
|
||||
|
||||
// 2. 发送消息到消息总线
|
||||
deviceMessageService.sendDeviceMessage(message, productKey, deviceName, serverId);
|
||||
|
||||
log.info("[handleBusinessMessage][JT808 业务消息已发送,clientId: {}, method: {}, messageId: {}]",
|
||||
|
||||
Reference in New Issue
Block a user